Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵增煜
/
tzt-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3a971251
authored
Nov 26, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
7f6e9cba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
+16
-14
app/Api/Controllers/DoctorController.php
+8
-7
app/Api/Controllers/PharmacyController.php
+8
-7
No files found.
app/Api/Controllers/DoctorController.php
View file @
3a971251
...
...
@@ -143,14 +143,15 @@ public function logout()
{
$authInfo
=
auth
(
'api'
)
->
user
();
// 医师表user_id改为0
$doctor
=
DoctorModel
::
where
(
'user_id'
,
$authInfo
->
id
)
->
first
();
if
(
!
$doctor
)
{
return
$this
->
failed
(
'医师信息不存在'
);
}
$doctor
->
user_id
=
0
;
$doctor
->
save
();
//
$doctor = DoctorModel::where('user_id', $authInfo->id)->first();
//
if (! $doctor) {
//
return $this->failed('医师信息不存在');
//
}
//
$doctor->user_id = 0;
//
$doctor->save();
// 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
)
{
return
$this
->
failed
(
'用户不存在'
);
}
...
...
app/Api/Controllers/PharmacyController.php
View file @
3a971251
...
...
@@ -156,14 +156,15 @@ public function logout()
$authInfo
=
auth
(
'api'
)
->
user
();
// 药店表user_id改为0
$pharmacy
=
PharmacyModel
::
where
(
'user_id'
,
$authInfo
->
id
)
->
first
();
if
(
!
$pharmacy
)
{
return
$this
->
failed
(
'药店信息不存在'
);
}
$pharmacy
->
user_id
=
0
;
$pharmacy
->
save
();
//
$pharmacy = PharmacyModel::where('user_id', $authInfo->id)->first();
//
if (! $pharmacy) {
//
return $this->failed('药店信息不存在');
//
}
//
$pharmacy->user_id = 0;
//
$pharmacy->save();
// 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
)
{
return
$this
->
failed
(
'用户不存在'
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment