Commit 3a971251 by 赵增煜

修改

parent 7f6e9cba
...@@ -143,14 +143,15 @@ public function logout() ...@@ -143,14 +143,15 @@ public function logout()
{ {
$authInfo = auth('api')->user(); $authInfo = auth('api')->user();
// 医师表user_id改为0 // 医师表user_id改为0
$doctor = DoctorModel::where('user_id', $authInfo->id)->first(); // $doctor = DoctorModel::where('user_id', $authInfo->id)->first();
if (! $doctor) { // if (! $doctor) {
return $this->failed('医师信息不存在'); // return $this->failed('医师信息不存在');
} // }
$doctor->user_id = 0; // $doctor->user_id = 0;
$doctor->save(); // $doctor->save();
// user表中last_login_type字段改为0 // user表中last_login_type字段改为0
$user = User::where('id', $authInfo->id)->where('last_login_type', User::LOGIN_TYPE_DOCTOR)->first(); // $user = User::where('id', $authInfo->id)->where('last_login_type', User::LOGIN_TYPE_DOCTOR)->first();
$user = User::where('id', $authInfo->id)->first();
if (! $user) { if (! $user) {
return $this->failed('用户不存在'); return $this->failed('用户不存在');
} }
......
...@@ -156,14 +156,15 @@ public function logout() ...@@ -156,14 +156,15 @@ public function logout()
$authInfo = auth('api')->user(); $authInfo = auth('api')->user();
// 药店表user_id改为0 // 药店表user_id改为0
$pharmacy = PharmacyModel::where('user_id', $authInfo->id)->first(); // $pharmacy = PharmacyModel::where('user_id', $authInfo->id)->first();
if (! $pharmacy) { // if (! $pharmacy) {
return $this->failed('药店信息不存在'); // return $this->failed('药店信息不存在');
} // }
$pharmacy->user_id = 0; // $pharmacy->user_id = 0;
$pharmacy->save(); // $pharmacy->save();
// user表last_login_type改为0 // user表last_login_type改为0
$user = User::where('id', $authInfo->id)->where('last_login_type', User::LOGIN_TYPE_PHARMACY)->first(); // $user = User::where('id', $authInfo->id)->where('last_login_type', User::LOGIN_TYPE_PHARMACY)->first();
$user = User::where('id', $authInfo->id)->first();
if (! $user) { if (! $user) {
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