Commit 49042472 by lujunyi

添加问诊人年龄报错

parent 650a7a89
...@@ -71,11 +71,11 @@ public function add(Request $request) ...@@ -71,11 +71,11 @@ public function add(Request $request)
return $this->failed('身份证格式错误'); return $this->failed('身份证格式错误');
} }
if (is_int($data['age']) || $data['age'] <= 0) { if (! isset($data['age']) || $data['age'] <= 0) {
return $this->failed('年龄格式错误'); return $this->failed('年龄格式错误');
} }
if (! array_key_exists($data['gender'], PatientModel::SEX_MAP)) { if (isset($data['gender']) && ! array_key_exists($data['gender'], PatientModel::SEX_MAP)) {
return $this->failed('性别错误'); return $this->failed('性别错误');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment