Commit f4d9be19 by 赵增煜

原用户清除login_type

parent 6f3bb8bf
......@@ -152,13 +152,26 @@ public function bindRole(Request $request)
if (! $pharmacy) {
return $this->failed('手机号不存在');
}
// 先把普通用户状态清除
if ($pharmacy->user_id > 0) {
$user = User::query()->find($pharmacy->user_id);
$user->last_login_type = 0;
$user->save();
}
$pharmacy->user_id = $authInfo->id;
$pharmacy->save();
} elseif ($login_type == User::LOGIN_TYPE_DOCTOR) {
$doctor = DoctorModel::query()->where('mobile', $mobile)->first();
if (! $doctor) {
return $this->failed('手机号不存在');
}
// 先把普通用户清除
if ($doctor->user_id > 0) {
$user = User::query()->find($doctor->user_id);
$user->last_login_type = 0;
$user->save();
}
$doctor->user_id = $authInfo->id;
$doctor->save();
} 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