Browse Source

用户登录封装

pull/1/head
pengda 9 months ago
parent
commit
a422f7d117
  1. 20
      model/mCase.php

20
model/mCase.php

@ -63,18 +63,10 @@ class mCase extends mBase {
} }
$data = array(); $data = array();
if (!empty($name)) { if (!empty($name)) $data['name']=$name;
$data['name']=$name; if (!empty($source)) $data['source']=$source;
} if (!empty($original)) $data['original']=$original;
if (!empty($source)) { if (!empty($method)) $data['method']=$method;
$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))); $res = $this->obj->update($this->tbl, $data, array('sql' => '`id`=?', 'vals' => array($id)));
if (!$res) { if (!$res) {
@ -101,7 +93,7 @@ class mCase extends mBase {
$herb = $this->getHerbByName($item['name']); $herb = $this->getHerbByName($item['name']);
if ($herb) { if ($herb) {
$temp['herb_id'] = $herb['id']; $temp['herb_id'] = $herb['id'];
}else{ } else {
$temp['herb_id'] = $this->createHerb(array('name' => $item['name'])); $temp['herb_id'] = $this->createHerb(array('name' => $item['name']));
} }
$case_herb[] = $temp; $case_herb[] = $temp;
@ -155,7 +147,7 @@ class mCase extends mBase {
return false; return false;
} }
} }
}else{ } else {
//需要增加药方对应的药材 //需要增加药方对应的药材
foreach ($new_data as $key => $value) { foreach ($new_data as $key => $value) {
if (!isset($old_data[$key])) { if (!isset($old_data[$key])) {

Loading…
Cancel
Save