diff --git a/model/mFormula.php b/model/mFormula.php index 36d77a5..ca1d8ad 100644 --- a/model/mFormula.php +++ b/model/mFormula.php @@ -136,13 +136,13 @@ class mFormula extends mBase { //药方信息 $formula = $this->getFormulaById($id); if (empty($formula)) { - $this->setError('查询不到此药方'); + $this->setError('抱歉,未找到匹配的药方'); return false; } //自拟药方 判断药方归属 if ($uid > 0 && $formula['uid'] > 0 && $formula['uid'] != $uid) { - $this->setError('这不是你的药方'); + $this->setError('抱歉,这不是你的药方'); return false; } @@ -245,7 +245,7 @@ class mFormula extends mBase { //自拟药方 克重不能为0 if ($uid > 0 && $num == 0) { - $this->setError("{$name}克重不能为零"); + $this->setError("抱歉,药材{$name}重量不能为零"); return false; } @@ -264,7 +264,7 @@ class mFormula extends mBase { } if (isset($herb_ids[$temp['herb_id']])) { - $this->setError("药材不能重复"); + $this->setError("抱歉,药方中存在重复的药材"); return false; } $herb_ids[$temp['herb_id']] = $temp['herb_id']; @@ -365,24 +365,24 @@ class mFormula extends mBase { public function saveFormula($uid, $id, $name, $source, $method, $herbs) { if (empty($name)) { - $this->setError('药方名称不能为空'); + $this->setError('请填写药方名称'); return false; } $herbs = json_decode($herbs, true); if (empty($herbs)) { - $this->setError('药方药材不能为空'); + $this->setError('请填写药方详情'); return false; } if ($id) { $formula = $this->getFormulaById($id); if (empty($formula)) { - $this->setError('查询不到此药方'); + $this->setError('抱歉,未找到匹配的药方'); return false; } if ($formula['uid'] != $uid) { - $this->setError('这不是你的药方'); + $this->setError('抱歉,这不是你的药方'); return false; } } @@ -430,7 +430,7 @@ class mFormula extends mBase { } $res = $this->insertFormulaHerb($formula_herb); if (!$res) { - $this->setError('批量添加药方药材关联失败'); + $this->setError('添加药方详情失败'); return false; } } else { @@ -447,7 +447,7 @@ class mFormula extends mBase { } $res = $this->mutiUpdateFormulaHerb($id, $formula_herb); if (!$res) { - $this->setError('批量更新药方药材关联失败'); + $this->setError('更新药方详情失败'); return false; } } @@ -458,11 +458,11 @@ class mFormula extends mBase { public function deleteFormula($uid, $id) { $formula = $this->getFormulaById($id); if (empty($formula)) { - $this->setError('查询不到此药方'); + $this->setError('抱歉,未找到匹配的药方'); return false; } if ($formula['uid'] != $uid) { - $this->setError('这不是你的药方'); + $this->setError('抱歉,这不是你的药方'); return false; } diff --git a/model/mUser.php b/model/mUser.php index 97af21f..c410e6e 100644 --- a/model/mUser.php +++ b/model/mUser.php @@ -57,7 +57,7 @@ class mUser extends mBase { public function getUserInfo($code) { $openid = $this->getOpenid($code); if (!$openid) { - $this->setError('获取openid失败'); + $this->setError('登录失败'); return false; } @@ -68,13 +68,13 @@ class mUser extends mBase { $identifier = $this->createUniqueID($openid); $user = $this->getUserByIdentifier($identifier); if ($user) { - $this->setError('uid生成失败'); + $this->setError('登录失败,用户已存在'); return false; } $uid = $this->createUser(array('identifier' => $identifier, 'openid' => $openid)); if (!$uid) { - $this->setError('用户创建失败'); + $this->setError('登录失败,用户不存在'); return false; } @@ -90,7 +90,6 @@ class mUser extends mBase { $jsonres = $this->getCUrl($get_openid_url); $get_openid_res = json_decode($jsonres, true); if (empty($get_openid_res['openid'])) { - $this->setError('获取openid失败'); $this->writeLog('user', 'get_openid_error_log', $get_openid_url . "|" . $jsonres); return false; } diff --git a/model/mUserCase.php b/model/mUserCase.php index fa8d6e1..f7c74b3 100644 --- a/model/mUserCase.php +++ b/model/mUserCase.php @@ -50,7 +50,7 @@ class mUserCase extends mBase { $user_case = $this->getUserCaseById($uid, $id); if (empty($user_case)) { - $this->setError('找不到相关医案'); + $this->setError('抱歉,未找到匹配的医案'); return false; } @@ -65,15 +65,15 @@ class mUserCase extends mBase { public function createUserCase($uid, $formula_id, $data) { if (empty($data['patient_name'])) { - $this->setError('患者姓名不能为空'); + $this->setError('请填写患者姓名'); return false; } - if ($data['patient_age'] <= 0) { + if ($data['patient_age'] <= 0 || $data['patient_age'] > 127) { $this->setError('患者年龄不正确'); return false; } if ($data['sex'] < 0) { - $this->setError('患者性别不能为空'); + $this->setError('患者性别不正确'); return false; } if ($data['prescribe_num'] <= 0) { @@ -85,15 +85,15 @@ class mUserCase extends mBase { return false; } if (empty($data['patient_say'])) { - $this->setError('主诉不能为空'); + $this->setError('请填写主诉'); return false; } if (empty($data['first_diagnosis'])) { - $this->setError('舌诊脉诊不能为空'); + $this->setError('请填写舌诊脉诊'); return false; } if (empty($data['diagnosis'])) { - $this->setError('诊断不能为空'); + $this->setError('请填写诊断'); return false; } @@ -102,12 +102,12 @@ class mUserCase extends mBase { $mformula = new mFormula(); $formula = $mformula->getFormulaById($formula_id); if (!$formula) { - $this->setError('找不到相关药方'); + $this->setError('抱歉,未找到匹配的药方'); return false; } if ($formula['uid'] > 0 && $uid != $formula['uid']) { - $this->setError('这不是你的药方'); + $this->setError('抱歉,这不是你的药方'); return false; } @@ -190,7 +190,7 @@ class mUserCase extends mBase { public function getUserCaseInfo($uid, $id) { $user_case = $this->getUserCaseById($uid, $id); if (empty($user_case)) { - $this->setError('找不到相关医案'); + $this->setError('抱歉,未找到匹配的医案'); return false; } @@ -199,7 +199,7 @@ class mUserCase extends mBase { if ($user_case['formula_id'] > 0) { $formula = $mformula->getFormulaInfo($user_case['formula_id'], $uid); if (empty($formula)) { - $this->setError('找不到相关药方'); + $this->setError('抱歉,未找到匹配的药方'); return false; }