|
@ -17,7 +17,7 @@ class mUserCase extends mBase { |
|
|
public function insertUserCase($info) { |
|
|
public function insertUserCase($info) { |
|
|
$id = $this->obj->insert($this->tbl, $info); |
|
|
$id = $this->obj->insert($this->tbl, $info); |
|
|
if (empty($id)) { |
|
|
if (empty($id)) { |
|
|
$this->setError('添加医案失败'); |
|
|
$this->writeLog('user_case', 'insert_error_log', '添加医案失败|' . json_encode($info, JSON_UNESCAPED_UNICODE)); |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -27,7 +27,7 @@ class mUserCase extends mBase { |
|
|
public function updateUserCase($id, $info) { |
|
|
public function updateUserCase($id, $info) { |
|
|
$res = $this->obj->update($this->tbl, $info, array('sql' => '`id`=?', 'vals' => array($id))); |
|
|
$res = $this->obj->update($this->tbl, $info, array('sql' => '`id`=?', 'vals' => array($id))); |
|
|
if (!$res) { |
|
|
if (!$res) { |
|
|
$this->setError('更新失败'); |
|
|
$this->writeLog('user_case', 'update_error_log', '更新医案失败|' . $id . '|' . json_encode($info, JSON_UNESCAPED_UNICODE)); |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -56,7 +56,7 @@ class mUserCase extends mBase { |
|
|
|
|
|
|
|
|
$res = $this->updateUserCase($id, $data); |
|
|
$res = $this->updateUserCase($id, $data); |
|
|
if (!$res) { |
|
|
if (!$res) { |
|
|
$this->writeLog('user_case', 'update_error_log', '更新医案失败|' . $uid . '|' . json_encode($data, JSON_UNESCAPED_UNICODE)); |
|
|
$this->setError('更新失败'); |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -151,7 +151,7 @@ class mUserCase extends mBase { |
|
|
|
|
|
|
|
|
$herb_id = $mformula->insertHerb(array('uid' => $uid, 'name' => $item['name'])); |
|
|
$herb_id = $mformula->insertHerb(array('uid' => $uid, 'name' => $item['name'])); |
|
|
if (!$herb_id) { |
|
|
if (!$herb_id) { |
|
|
$this->writeLog('formula', 'insert_error_log', '添加药材失败|' . $uid . '|' . $item['name']); |
|
|
$this->setError('添加药材失败'); |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -171,7 +171,7 @@ class mUserCase extends mBase { |
|
|
|
|
|
|
|
|
$id = $this->insertUserCase($data); |
|
|
$id = $this->insertUserCase($data); |
|
|
if (!$id) { |
|
|
if (!$id) { |
|
|
$this->writeLog('user_case', 'insert_error_log', '添加医案失败|' . $uid . '|' . json_encode($data, JSON_UNESCAPED_UNICODE)); |
|
|
$this->setError('添加医案失败'); |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -179,7 +179,7 @@ class mUserCase extends mBase { |
|
|
//更新用户药方使用次数 |
|
|
//更新用户药方使用次数 |
|
|
$res = $mformula->updateFormulaUseLog($uid, $formula_id); |
|
|
$res = $mformula->updateFormulaUseLog($uid, $formula_id); |
|
|
if (!$res) { |
|
|
if (!$res) { |
|
|
$this->writeLog('formula', 'update_error_log', '药方使用次数更新失败|' . $uid . '|' . $formula_id); |
|
|
$this->setError('药方使用次数更新失败'); |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -227,7 +227,6 @@ class mUserCase extends mBase { |
|
|
|
|
|
|
|
|
$user_case['prescribe_herb'] = $prescribe_herb; |
|
|
$user_case['prescribe_herb'] = $prescribe_herb; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $user_case; |
|
|
return $user_case; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -295,7 +294,6 @@ class mUserCase extends mBase { |
|
|
|
|
|
|
|
|
$value['formula_info'] = ''; |
|
|
$value['formula_info'] = ''; |
|
|
if (isset($formula_arr[$value['formula_id']])) { |
|
|
if (isset($formula_arr[$value['formula_id']])) { |
|
|
|
|
|
|
|
|
$formula_info = $formula_arr[$value['formula_id']]; |
|
|
$formula_info = $formula_arr[$value['formula_id']]; |
|
|
|
|
|
|
|
|
$value['formula_info'] .= "选 "; |
|
|
$value['formula_info'] .= "选 "; |
|
|