Commit 80d2f996 authored by zhoujun's avatar zhoujun

替换字符串

parent ada89979
...@@ -340,9 +340,16 @@ class CardController extends Controller ...@@ -340,9 +340,16 @@ class CardController extends Controller
if (empty($roleId) || empty($serverId)) return $this->jsonReturn(7002, '参数错误'); if (empty($roleId) || empty($serverId)) return $this->jsonReturn(7002, '参数错误');
$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 = '';
if($info->server_name != ''){
$serverName = str_replace('硬核-','',$info->server_name);
$serverName = str_replace('非硬核-','',$serverName);
$serverName = str_replace('越狱-','',$serverName);
}
$user = User::where('uid',$userId)->select('uid','account')->first(); $user = User::where('uid',$userId)->select('uid','account')->first();
$data['userName'] = $user->account ?? ''; $data['userName'] = $user->account ?? '';
$data['serverName'] = $serverName;
$img = WxUserImg::where('uid',$userId)->where('role_id',$info->id)->where('server_id',$info->server_id)->select('id','img_url','status')->first(); $img = WxUserImg::where('uid',$userId)->where('role_id',$info->id)->where('server_id',$info->server_id)->select('id','img_url','status')->first();
if($img){ if($img){
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</div> </div>
<ul> <ul>
<li class="role1"><span>{{ $info->role_name ?? '' }}</span></li> <li class="role1"><span>{{ $info->role_name ?? '' }}</span></li>
<li class="role2"><span>{{ $info->server_name ?? '' }}</span></li> <li class="role2"><span>{{ $serverName }}</span></li>
</ul> </ul>
</div> </div>
<div class="right"> <div class="right">
......
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