From a422f7d117d0853fd2910aef5ce2bd361fd460da Mon Sep 17 00:00:00 2001 From: pengda <10266652509@qq.com> Date: Tue, 3 Sep 2024 11:02:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95=E5=B0=81?= =?UTF-8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/mCase.php | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/model/mCase.php b/model/mCase.php index acb5c64..5fbd79a 100644 --- a/model/mCase.php +++ b/model/mCase.php @@ -63,18 +63,10 @@ class mCase extends mBase { } $data = array(); - if (!empty($name)) { - $data['name']=$name; - } - if (!empty($source)) { - $data['source']=$source; - } - if (!empty($original)) { - $data['original']=$original; - } - if (!empty($method)) { - $data['method']=$method; - } + if (!empty($name)) $data['name']=$name; + if (!empty($source)) $data['source']=$source; + if (!empty($original)) $data['original']=$original; + if (!empty($method)) $data['method']=$method; $res = $this->obj->update($this->tbl, $data, array('sql' => '`id`=?', 'vals' => array($id))); if (!$res) { @@ -101,7 +93,7 @@ class mCase extends mBase { $herb = $this->getHerbByName($item['name']); if ($herb) { $temp['herb_id'] = $herb['id']; - }else{ + } else { $temp['herb_id'] = $this->createHerb(array('name' => $item['name'])); } $case_herb[] = $temp; @@ -155,7 +147,7 @@ class mCase extends mBase { return false; } } - }else{ + } else { //需要增加药方对应的药材 foreach ($new_data as $key => $value) { if (!isset($old_data[$key])) {