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
67ce9bf1
authored
Nov 28, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
d71bdc0d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
19 deletions
+14
-19
app/Api/Controllers/UserController.php
+14
-19
No files found.
app/Api/Controllers/UserController.php
View file @
67ce9bf1
...
...
@@ -152,21 +152,14 @@ 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
();
}
// 把所有user_id:$authInfo->id的置为0
PharmacyModel
::
where
(
'user_id'
,
$authInfo
->
id
)
->
update
([
'user_id'
=>
0
]);
// $pharmacy_list = PharmacyModel::where('user_id', $login_type)->get();
// if( $pharmacy_list->count() > 0 ) {
// foreach ($pharmacy_list as $pharmacyInfo){
// $pharmacyInfo->user_id = 0;
// $pharmacyInfo->save();
// }
// }
// 先把普通用户状态清除
// 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
();
...
...
@@ -175,14 +168,16 @@ public function bindRole(Request $request)
if
(
!
$doctor
)
{
return
$this
->
failed
(
'手机号不存在'
);
}
// 先把普通用户清除
if
(
$doctor
->
user_id
>
0
)
{
$user
=
User
::
query
()
->
find
(
$doctor
->
user_id
);
$user
->
last_login_type
=
0
;
$user
->
save
();
}
// 把所有user_id:$authInfo->id的置为0
DoctorModel
::
where
(
'user_id'
,
$authInfo
->
id
)
->
update
([
'user_id'
=>
0
]);
// 先把普通用户清除
// 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
{
...
...
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