Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uc_card
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhoujun
uc_card
Commits
ec9d1ea7
Commit
ec9d1ea7
authored
Jun 10, 2021
by
zhoujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
放开限制
parent
dc22bac0
Pipeline
#1617
passed with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
19 deletions
+30
-19
src/app/Http/Controllers/Admin/AdminController.php
src/app/Http/Controllers/Admin/AdminController.php
+16
-12
src/app/Http/Controllers/Card/CardController.php
src/app/Http/Controllers/Card/CardController.php
+14
-7
No files found.
src/app/Http/Controllers/Admin/AdminController.php
View file @
ec9d1ea7
...
...
@@ -155,7 +155,10 @@ class AdminController extends Controller
$row
=
WxUserImg
::
find
(
$id
);
if
(
!
$row
)
return
$this
->
getErrorMsg
(
'10061'
,
'数据异常'
);
$row
->
status
=
$status
;
if
(
$row
->
save
())
return
$this
->
getSuccessMsg
([]);
if
(
$row
->
save
()){
Cache
::
forget
(
'card:info:'
.
$row
->
uid
.
':'
.
$row
->
role
);
return
$this
->
getSuccessMsg
([]);
}
return
$this
->
getErrorMsg
(
'10063'
,
'审核失败'
);
}
...
...
@@ -170,17 +173,18 @@ class AdminController extends Controller
$ids
=
explode
(
'#'
,
$postData
[
'ids'
]);
$status
=
$postData
[
'status'
];
if
(
!
in_array
(
$status
,[
1
,
2
])
||
empty
(
$ids
))
return
$this
->
getErrorMsg
(
'10060'
,
'参数错误'
);
// $imgs = WxUserImg::whereIn('id',$ids)->select('id','loacl_url','status')->get();
// $result = true;
// foreach($imgs as $img){
// $img->status = 1;
// if($img->save()){
// if($status == 2) unlink(storage_path('app').'/'.$img->loacl_url);
// }else{
// $result = false;
// }
// }
$result
=
WxUserImg
::
whereIn
(
'id'
,
$ids
)
->
update
([
'status'
=>
$status
]);
$imgs
=
WxUserImg
::
whereIn
(
'id'
,
$ids
)
->
select
(
'id'
,
'uid'
,
'role'
,
'loacl_url'
,
'status'
)
->
get
();
$result
=
true
;
foreach
(
$imgs
as
$img
){
$img
->
status
=
1
;
if
(
$img
->
save
()){
Cache
::
forget
(
'card:info:'
.
$img
->
uid
.
':'
.
$img
->
role
);
//if($status == 2) unlink(storage_path('app').'/'.$img->loacl_url);
}
else
{
$result
=
false
;
}
}
//$result = WxUserImg::whereIn('id',$ids)->update(['status' => $status]);
if
(
$result
)
return
$this
->
getSuccessMsg
([]);
return
$this
->
getErrorMsg
(
'10063'
,
'审核失败'
);
}
...
...
src/app/Http/Controllers/Card/CardController.php
View file @
ec9d1ea7
...
...
@@ -315,7 +315,10 @@ class CardController extends Controller
$img
->
img_url
=
$data
[
'yunUrl'
];
$img
->
status
=
0
;
$img
->
is_upload
=
0
;
if
(
$img
->
save
())
return
true
;
if
(
$img
->
save
()){
Cache
::
forget
(
'card:info:'
.
$img
->
uid
.
':'
.
$img
->
role
);
return
true
;
}
}
else
{
$row
=
new
WxUserImg
();
$row
->
uid
=
$userId
;
...
...
@@ -327,8 +330,12 @@ class CardController extends Controller
$row
->
status
=
0
;
$row
->
is_upload
=
0
;
$row
->
remark
=
''
;
if
(
$row
->
save
())
return
true
;
if
(
$row
->
save
()){
Cache
::
forget
(
'card:info:'
.
$userId
.
':'
.
$role
);
return
true
;
}
}
return
false
;
}
...
...
@@ -349,9 +356,9 @@ class CardController extends Controller
}
$data
=
[];
//
if(Cache::has('card:info:'.$userId.':'.$roleId)){
//
$data = Cache::get('card:info:'.$userId.':'.$roleId);
//
}else{
if
(
Cache
::
has
(
'card:info:'
.
$userId
.
':'
.
$roleId
)){
$data
=
Cache
::
get
(
'card:info:'
.
$userId
.
':'
.
$roleId
);
}
else
{
$result
=
$this
->
getVerityLogin
(
$userId
);
if
(
$result
[
'code'
]
!=
200
)
return
$this
->
jsonReturn
(
$result
[
'code'
],
$result
[
'msg'
]);
if
(
empty
(
$roleId
)
||
empty
(
$serverId
))
return
$this
->
jsonReturn
(
7002
,
'参数错误'
);
...
...
@@ -469,8 +476,8 @@ class CardController extends Controller
}
else
{
$data
[
'braveTime'
]
=
'00:00'
;
}
//
Cache::put('card:info:'.$userId.':'.$roleId,$data,300);
//
}
Cache
::
put
(
'card:info:'
.
$userId
.
':'
.
$roleId
,
$data
,
300
);
}
if
(
Cache
::
has
(
'card:num:'
.
$userId
.
':'
.
$roleId
)){
$num
=
Cache
::
get
(
'card:num:'
.
$userId
.
':'
.
$roleId
)
+
1
;
...
...
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