Commit ec9d1ea7 authored by zhoujun's avatar zhoujun

放开限制

parent dc22bac0
Pipeline #1617 passed with stage
in 0 seconds
......@@ -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', '审核失败');
}
......
......@@ -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;
......
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 to comment