Commit c5fd1a8f by 赵增煜

问诊人新增修改

parent 5631651e
......@@ -59,10 +59,15 @@ public function add(Request $request)
if (! validateIdCard($data['id_card'])) {
return $this->failed('身份证格式错误');
}
$patient = new PatientModel;
$idCardInfo = Util::getIdCardInfo($data['id_card']);
$data['gender'] = $idCardInfo['gender'];
$data['is_default'] = 0;
$res = PatientModel::create($data);
$patient->name = $data['name'];
$patient->id_card = $data['id_card'];
$patient->mobile = $data['mobile'];
$patient->gender = $idCardInfo['gender'];
$patient->is_default = 0;
# $res = PatientModel::create($data);
$res = $patient->save();
if ($res) {
return $this->success($res);
} else {
......
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