Commit cb042075 authored by liyadong's avatar liyadong

Merge branch 'test' of http://gitlab.cccwangluo.com/zhoujun/uc_card into test

parents cd544fe7 c26d2b0c
...@@ -62,7 +62,7 @@ class Handler extends ExceptionHandler ...@@ -62,7 +62,7 @@ class Handler extends ExceptionHandler
} }
if ($exception instanceof QueryException) { if ($exception instanceof QueryException) {
return new JsonResponse(['error' => 5001, 'message' => '网络错误']); return response()->json(['error' => 5001, 'message' => '网络错误']);
} }
if ($exception instanceof ErrorException) { if ($exception instanceof ErrorException) {
......
...@@ -156,6 +156,9 @@ class CardController extends Controller ...@@ -156,6 +156,9 @@ class CardController extends Controller
$first = $rankConfig[$first] ?? ''; $first = $rankConfig[$first] ?? '';
if($first != '') $maxRank = $first.$second; if($first != '') $maxRank = $first.$second;
} }
$honorLevel = $roleInfo['HonorLevel'] ?? 0;
$armsIds = []; $armsIds = [];
$armsScore = []; $armsScore = [];
$armsStrong = []; $armsStrong = [];
...@@ -221,7 +224,7 @@ class CardController extends Controller ...@@ -221,7 +224,7 @@ class CardController extends Controller
if($braveTime < 1) $braveTime = 0; if($braveTime < 1) $braveTime = 0;
if($mercenaryScore < 1) $mercenaryScore = 0; if($mercenaryScore < 1) $mercenaryScore = 0;
$arrayData = ['uid'=>$userId,'server_id'=>$serverId,'server_name'=>$serverName,'user_id'=>$targetRole['userId'],'role_id'=>$roleId,'role_name'=>$targetRole['roleName'],'job'=>$targetRole['occupation'],'guild'=>$targetRole['guild'],'online_time'=>$targetRole['onlineTime'],'register_time'=>date('Y-m-d H:i:s',$targetRole['createTime']),'role_score'=>$roleScore,'arms_score'=>$armsScoreArr,'arms_strong'=>$armsStrongArr,'arms_exciting'=>$armsExcitingArr,'duel_total'=>$duelTotal,'duel_win'=>$duelWin,'duel_continuity_win'=>$duelContinuityWin,'max_rank'=>$maxRank,'brave_num'=>$braveNum,'brave_time'=>$braveTime,'mercenary_score'=>$mercenaryScore,'created_at'=>$time,'updated_at'=>$time]; $arrayData = ['uid'=>$userId,'server_id'=>$serverId,'server_name'=>$serverName,'user_id'=>$targetRole['userId'],'role_id'=>$roleId,'role_name'=>$targetRole['roleName'],'job'=>$targetRole['occupation'],'guild'=>$targetRole['guild'],'online_time'=>$targetRole['onlineTime'],'register_time'=>date('Y-m-d H:i:s',$targetRole['createTime']),'role_score'=>$roleScore,'arms_score'=>$armsScoreArr,'arms_strong'=>$armsStrongArr,'arms_exciting'=>$armsExcitingArr,'duel_total'=>$duelTotal,'duel_win'=>$duelWin,'duel_continuity_win'=>$duelContinuityWin,'max_rank'=>$maxRank,'brave_num'=>$braveNum,'brave_time'=>$braveTime,'mercenary_score'=>$mercenaryScore,'honor_level'=>$honorLevel,'created_at'=>$time,'updated_at'=>$time];
$result = DB::connection('wx_mysql')->table($tableName)->insert($arrayData); $result = DB::connection('wx_mysql')->table($tableName)->insert($arrayData);
if($result) return $array; if($result) return $array;
...@@ -239,7 +242,7 @@ class CardController extends Controller ...@@ -239,7 +242,7 @@ class CardController extends Controller
public function getCheckRoleInfoTable($tableName) public function getCheckRoleInfoTable($tableName)
{ {
if ( ! Schema::connection('wx_mysql')->hasTable($tableName)) { if (!Schema::connection('wx_mysql')->hasTable($tableName)) {
Schema::connection('wx_mysql')->create($tableName, function (Blueprint $table) { Schema::connection('wx_mysql')->create($tableName, function (Blueprint $table) {
$table->bigIncrements('id')->comment('自增主键'); $table->bigIncrements('id')->comment('自增主键');
$table->integer('uid')->default(0)->comment('用户id'); $table->integer('uid')->default(0)->comment('用户id');
...@@ -263,6 +266,7 @@ class CardController extends Controller ...@@ -263,6 +266,7 @@ class CardController extends Controller
$table->integer('brave_num')->default(0)->comment('勇者之塔最高层数'); $table->integer('brave_num')->default(0)->comment('勇者之塔最高层数');
$table->integer('brave_time')->default(0)->comment('勇者之塔过关时间'); $table->integer('brave_time')->default(0)->comment('勇者之塔过关时间');
$table->integer('mercenary_score')->default(0)->comment('佣兵团评分'); $table->integer('mercenary_score')->default(0)->comment('佣兵团评分');
$table->integer('honor_level')->default(0)->comment('荣誉等级');
$table->timestamps(); $table->timestamps();
$table->index(['uid','role_id']); $table->index(['uid','role_id']);
$table->engine = 'InnoDB'; $table->engine = 'InnoDB';
...@@ -339,6 +343,7 @@ class CardController extends Controller ...@@ -339,6 +343,7 @@ class CardController extends Controller
$roleId = $request->input('roleId'); $roleId = $request->input('roleId');
$serverId = $request->input('serverId'); $serverId = $request->input('serverId');
if (empty($roleId) || empty($serverId)) return $this->jsonReturn(7002, '参数错误'); if (empty($roleId) || empty($serverId)) return $this->jsonReturn(7002, '参数错误');
if (!Schema::connection('wx_mysql')->hasTable('wx_card_role_'.$serverId)) return redirect(route('index'));
$info = DB::connection('wx_mysql')->table('wx_card_role_'.$serverId)->where('uid',$userId)->where('role_id',$roleId)->where('server_id',$serverId)->first(); $info = DB::connection('wx_mysql')->table('wx_card_role_'.$serverId)->where('uid',$userId)->where('role_id',$roleId)->where('server_id',$serverId)->first();
if(!$info) return redirect(route('index')); if(!$info) return redirect(route('index'));
$serverName = ''; $serverName = '';
...@@ -380,6 +385,9 @@ class CardController extends Controller ...@@ -380,6 +385,9 @@ class CardController extends Controller
$data['roleScore'] = $roleScore; $data['roleScore'] = $roleScore;
$data['jobImg'] = $jobInco[$info->job] ?? ''; $data['jobImg'] = $jobInco[$info->job] ?? '';
$honorConfig = config('sign.honor');
$data['honor'] = $honorConfig[$info->honor_level] ?? $honorConfig[0];
if($info->mercenary_score == 2){ if($info->mercenary_score == 2){
$data['ybImg'] = 'img-B'; $data['ybImg'] = 'img-B';
}elseif($info->mercenary_score == 3){ }elseif($info->mercenary_score == 3){
......
...@@ -133,6 +133,25 @@ return [ ...@@ -133,6 +133,25 @@ return [
'阵魔' => 'https://aldzn-ios-cdn.aldzn.cn/ucCard/images/role/22.png', '阵魔' => 'https://aldzn-ios-cdn.aldzn.cn/ucCard/images/role/22.png',
], ],
'honor' => [
0 => '决斗练习者',
1 => '决斗练习者',
2 => '入门决斗者',
3 => '初级决斗者',
4 => '中级决斗者',
5 => '高级决斗者',
6 => '特级决斗者',
7 => '职业决斗家',
8 => '明星决斗家',
9 => '武道高手',
10 => '决斗达人',
11 => '竞技大师',
12 => '传奇武士',
13 => '格斗之王',
14 => '荣耀天王',
15 => '神·职业'
],
'WX_APPID' => 'wx2db57391553aa064', 'WX_APPID' => 'wx2db57391553aa064',
'WX_AppSecret' => 'f6d533f6d0851c629da52cd10fab910b', 'WX_AppSecret' => 'f6d533f6d0851c629da52cd10fab910b',
'rank' => [1=>'青铜',2=>'白银',3=>'黄金',4=>'铂金',5=>'钻石',6=>'最强王者'], 'rank' => [1=>'青铜',2=>'白银',3=>'黄金',4=>'铂金',5=>'钻石',6=>'最强王者'],
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
0 0
@endif @endif
小时</span></li> 小时</span></li>
<li class="role6"><span>荣誉称号</span></li> <li class="role6"><span>{{ $honor }}</span></li>
</ul> </ul>
</div> </div>
<div class="bottom"> <div class="bottom">
......
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