Commit 0e4f7649 authored by 顾敏's avatar 顾敏

审核图片实时给结果

parent df1ecdf0
...@@ -347,15 +347,20 @@ class CardController extends Controller ...@@ -347,15 +347,20 @@ class CardController extends Controller
$roleId = $request->input('roleId'); $roleId = $request->input('roleId');
$serverId = $request->input('serverId'); $serverId = $request->input('serverId');
$result = $this->getVerityLogin($userId);
if($result['code'] != 200) return $this->jsonReturn($result['code'], $result['msg']);
if (empty($roleId) || empty($serverId)) return $this->jsonReturn(7002, '参数错误');
$data = []; $data = [];
if(Cache::has('card:info:'.$userId.':'.$roleId)){ if(Cache::has('card:info:'.$userId.':'.$roleId)){
$data = Cache::get('card:info:'.$userId.':'.$roleId); $data = Cache::get('card:info:'.$userId.':'.$roleId);
}else{ }else{
$result = $this->getVerityLogin($userId); $info = DB::connection('wx_mysql')->table('wx_card_role_'.$serverId)
if($result['code'] != 200) return $this->jsonReturn($result['code'], $result['msg']); ->where('uid',$userId)
if (empty($roleId) || empty($serverId)) return $this->jsonReturn(7002, '参数错误'); ->where('role_id',$roleId)
// if (!Schema::connection('wx_mysql')->hasTable('wx_card_role_'.$serverId)) return redirect(route('index')); ->where('server_id',$serverId)
$info = DB::connection('wx_mysql')->table('wx_card_role_'.$serverId)->where('uid',$userId)->where('role_id',$roleId)->where('server_id',$serverId)->first(); ->first();
if(!$info) return redirect(route('index')); if(!$info) return redirect(route('index'));
$filterElems = ['越狱', 'IOS', 'mg77', '抖音', '硬核', '非硬核', 'zy', '915转移', '转移', '小米', '百度']; $filterElems = ['越狱', 'IOS', 'mg77', '抖音', '硬核', '非硬核', 'zy', '915转移', '转移', '小米', '百度'];
...@@ -366,23 +371,6 @@ class CardController extends Controller ...@@ -366,23 +371,6 @@ class CardController extends Controller
$data['userName'] = $user->account ?? ''; $data['userName'] = $user->account ?? '';
$data['serverName'] = $serverName; $data['serverName'] = $serverName;
$img = WxUserImg::where('uid',$userId)->where('role_id',$info->id)->where('server_id',$info->server_id)->select('id','img_url','status','is_upload')->first();
if($img){
if($img->status == 1){
if($img->is_upload == 1){
$data['userImgStatus'] = 1;
}else{
$data['userImgStatus'] = 0;
}
}else{
$data['userImgStatus'] = $img->status;
}
$data['userImg'] = $img->img_url;
}else{
$data['userImg'] = '';
$data['userImgStatus'] = -1;
}
$armsScore = []; $armsScore = [];
$armsStrong = []; $armsStrong = [];
$armsExciting = []; $armsExciting = [];
...@@ -390,13 +378,6 @@ class CardController extends Controller ...@@ -390,13 +378,6 @@ class CardController extends Controller
if($info->arms_strong != '') $armsStrong = json_decode($info->arms_strong,true); if($info->arms_strong != '') $armsStrong = json_decode($info->arms_strong,true);
if($info->arms_exciting != '') $armsExciting = json_decode($info->arms_exciting,true); if($info->arms_exciting != '') $armsExciting = json_decode($info->arms_exciting,true);
// $roleScore = '00000';
// if(strlen($info->role_score) == 1) $roleScore = '0000'.(string)$info->role_score;
// if(strlen($info->role_score) == 2) $roleScore = '000'.(string)$info->role_score;
// if(strlen($info->role_score) == 3) $roleScore = '00'.(string)$info->role_score;
// if(strlen($info->role_score) == 4) $roleScore = '0'.(string)$info->role_score;
// if(strlen($info->role_score) == 5) $roleScore = (string)$info->role_score;
$roleScore = str_pad($info->role_score, 5, "0", STR_PAD_LEFT); $roleScore = str_pad($info->role_score, 5, "0", STR_PAD_LEFT);
$jobInco = config('sign.jobInco'); $jobInco = config('sign.jobInco');
...@@ -423,13 +404,6 @@ class CardController extends Controller ...@@ -423,13 +404,6 @@ class CardController extends Controller
$data['rank'] = empty($info->max_rank) ? '青铜5' : $info->max_rank; $data['rank'] = empty($info->max_rank) ? '青铜5' : $info->max_rank;
if(!empty($armsScore)){ if(!empty($armsScore)){
// $armsScoreNum = '00000';
// if(strlen($armsScore[0]['score']) == 1) $armsScoreNum = '0000'.(string)$armsScore[0]['score'];
// if(strlen($armsScore[0]['score']) == 2) $armsScoreNum = '000'.(string)$armsScore[0]['score'];
// if(strlen($armsScore[0]['score']) == 3) $armsScoreNum = '00'.(string)$armsScore[0]['score'];
// if(strlen($armsScore[0]['score']) == 4) $armsScoreNum = '0'.(string)$armsScore[0]['score'];
// if(strlen($armsScore[0]['score']) == 5) $armsScoreNum = (string)$armsScore[0]['score'];
$armsScoreNum = str_pad($armsScore[0]['score'], 5, "0", STR_PAD_LEFT); $armsScoreNum = str_pad($armsScore[0]['score'], 5, "0", STR_PAD_LEFT);
$data['armsScoreName'] = $armsScore[0]['name']; $data['armsScoreName'] = $armsScore[0]['name'];
$data['armsScore'] = $armsScoreNum; $data['armsScore'] = $armsScoreNum;
...@@ -473,6 +447,27 @@ class CardController extends Controller ...@@ -473,6 +447,27 @@ class CardController extends Controller
Cache::put('card:info:'.$userId.':'.$roleId,$data, 86400); Cache::put('card:info:'.$userId.':'.$roleId,$data, 86400);
} }
$img = WxUserImg::where('uid',$userId)
->where('role_id', $roleId)
->where('server_id', $serverId)
->select('id','img_url','status','is_upload')
->first();
if($img){
if($img->status == 1){
if($img->is_upload == 1){
$data['userImgStatus'] = 1;
}else{
$data['userImgStatus'] = 0;
}
}else{
$data['userImgStatus'] = $img->status;
}
$data['userImg'] = $img->img_url;
}else{
$data['userImg'] = '';
$data['userImgStatus'] = -1;
}
return view('card.card', $data); return view('card.card', $data);
} }
} }
\ No newline at end of file
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