Commit b1bc81ee by 赵增煜

增加name+手机号判断是否存在

parent 9d9cd099
...@@ -238,6 +238,11 @@ public function duplicate(Request $request) ...@@ -238,6 +238,11 @@ public function duplicate(Request $request)
$newPatient->user_id = $authInfo->id; $newPatient->user_id = $authInfo->id;
} elseif ($authInfo->last_login_type == User::LOGIN_TYPE_PHARMACY) { // 药店 } elseif ($authInfo->last_login_type == User::LOGIN_TYPE_PHARMACY) { // 药店
$pharmacy = PharmacyModel::query()->where('user_id', $authInfo->id)->first(); $pharmacy = PharmacyModel::query()->where('user_id', $authInfo->id)->first();
# 校验该药店是否已经存在手机号+用户名
$patient = PatientModel::where('mobile', $existingPatient->mobile)->where('name', $existingPatient->name)->where('pharmacy_id', $authInfo->id)->first();
if ($patient) {
return $this->failed('该问诊人信息已存在');
}
if ($pharmacy) { if ($pharmacy) {
$newPatient->pharmacy_id = $pharmacy->id; $newPatient->pharmacy_id = $pharmacy->id;
} else { } 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