Przeglądaj źródła

客服用列表 可导出

Tree 5 godzin temu
rodzic
commit
db272760c5

+ 27 - 0
app/Http/Controllers/Admin/GlobalController.php

@@ -568,6 +568,33 @@ class GlobalController extends Controller
 
     }
 
+    public function userNewList(Request $request)
+    {
+        $adminChannels = session('admin_channels');
+        $gameID = (int)$request->GameID ?: "";
+        $startTime = str_replace('T', ' ', $request->start_time ?? "");
+        $endTime = str_replace('T', ' ', $request->end_time ?? "");
+        $lstartTime = str_replace('T', ' ', $request->lstart_time ?? "");
+        $lendTime = str_replace('T', ' ', $request->lend_time ?? "");
+        $channel = $request->channel;
+        $minRecharge = $request->minRecharge ?: '';
+        $maxRecharge = $request->maxRecharge ?: '';
+        $excel = $request->excel ?? "";
+
+        $channels = $adminChannels;
+
+        $list = (new GlobalUser())->userNewList($gameID, $startTime, $endTime, $lstartTime, $lendTime, $channel, $minRecharge, $maxRecharge, $excel);
+
+        if ($excel) {
+            return;
+        }
+
+        return view('admin.global.user_new_list', compact(
+            'list', 'gameID', 'startTime', 'endTime', 'lstartTime', 'lendTime',
+            'channel', 'channels', 'minRecharge', 'maxRecharge'
+        ));
+    }
+
     //用户列表
     public function userlist1(Request $request)
     {

+ 5 - 9
app/Services/GlobalUser.php

@@ -288,11 +288,6 @@ class GlobalUser extends BaseApiLogic
         $where = [];
         if (!empty($gameID))
             $where[] = ['ai.GameID', $gameID];
-
-        if (!empty($gameID))
-            $where[] = ['ai.GameID', $gameID];
-        if (!empty($nickName))
-            $where[] = ['ai.NickName', $nickName];
         if (!empty($startTime))
             $where[] = ['ai.RegisterDate', '>=', $startTime];
         if (!empty($endTime))
@@ -324,9 +319,10 @@ class GlobalUser extends BaseApiLogic
             //exit();
             foreach ($list as &$value) {
                 $value['Nullity'] = $value['Nullity'] == 0 ? '正常' : '封禁';
-                $value['Score'] = $value['Score'] / NumConfig::NUM_VALUE;
-                $value['Withdraw'] = $value['Withdraw'] / NumConfig::NUM_VALUE;
-                $value['totalScore'] = intval($value['WinScore']+ $value['LostScore'])/NumConfig::NUM_VALUE;
+                $value['Score'] = (string)round($value['Score'] / NumConfig::NUM_VALUE, 2);
+                $value['Withdraw'] = (string)round(($value['Withdraw'] ?? 0) / NumConfig::NUM_VALUE, 2);
+                $value['Recharge'] = (string)($value['Recharge'] ?? 0);
+                $value['totalScore'] = (string)round(intval(($value['WinScore'] ?? 0) + ($value['LostScore'] ?? 0)) / NumConfig::NUM_VALUE, 2);
                 unset($value['WinScore']);
                 unset($value['LostScore']);
             }
@@ -334,7 +330,7 @@ class GlobalUser extends BaseApiLogic
             $title = ['UserID', '玩家ID', '昵称','余额', '状态', '离线时间', '注册时间', '玩家渠道', '手机号', '充值', '提现', '输赢'];
 //            $cellData = json_decode(json_encode($list), true);
             downloadExcel($list, $title, '用户列表');
-//            exit();
+            return;
         }
 
         $list = $Sql->where($where)->orderByRaw($orderBy)->paginate(10);

+ 149 - 0
resources/views/admin/global/user_new_list.blade.php

@@ -0,0 +1,149 @@
+@extends('base.base')
+@section('base')
+    <!-- 内容区域 -->
+    <div class="main-panel">
+        <div class="content-wrapper">
+            <div class="page-header">
+                <h3 class="page-title">
+                     <span class="page-title-icon bg-gradient-primary text-white mr-2">
+                        <i class="mdi mdi-settings"></i>
+                    </span>
+                    用户数据(新)
+                </h3>
+                <nav aria-label="breadcrumb">
+                    <ol class="breadcrumb">
+                        <li class="breadcrumb-item"><a href="#">用户数据</a></li>
+                        <li class="breadcrumb-item active" aria-current="page">用户数据(新)</li>
+                    </ol>
+                </nav>
+            </div>
+
+            <div class="row">
+                <div class="col-lg-12 grid-margin stretch-card">
+                    <div class="card">
+                        <div class="card-body">
+                            <h4 class="card-title">用户数据(新)</h4>
+                            <form class="well form-inline margin-top-20" method="get" action="/admin/global/user_new_list">
+                                <div>
+                                    <span style="padding-left: 10px">{{ __('auto.会员ID:') }}</span>
+                                    <input class="form-control" type="text" name="GameID" value="{{$gameID}}">
+
+                                    <span style="padding-left: 10px">{{ __('auto.注册时间:') }}</span>
+                                    <input type="datetime-local" step="01" name="start_time" id="start_time" class="form-control" value="{{$startTime}}" onclick="start_times('start_time')"/>
+                                    <input type="datetime-local" step="01" name="end_time" id="end_time" class="form-control" value="{{$endTime}}" onclick="end_times('end_time')"/>
+
+                                    <span style="padding-left: 10px">{{ __('auto.上次离线时间') }}:</span>
+                                    <input type="datetime-local" step="01" name="lstart_time" id="lstart_time" class="form-control" value="{{$lstartTime}}" onclick="start_times('lstart_time')"/>
+                                    <input type="datetime-local" step="01" name="lend_time" id="lend_time" class="form-control" value="{{$lendTime}}" onclick="end_times('lend_time')"/>
+                                    <br>
+
+                                    <span style="padding-left: 10px">{{ __('auto.渠道名称:') }}</span>
+                                    <select class="form-control" name="channel" style="color: black">
+                                        <option value="">{{ __('auto.全部渠道') }}</option>
+                                        @foreach($channels as $key=>$val)
+                                            <option value="{{$val}}" @if($channel == $val) selected @endif>{{$val}}</option>
+                                        @endforeach
+                                    </select> &nbsp;&nbsp;
+
+                                    <span style="padding-left: 10px">充值金额范围:</span>
+                                    <input class="form-control" type="text" name="minRecharge" placeholder="最小" style="width:80px" value="{{$minRecharge}}">
+                                    ~
+                                    <input class="form-control" type="text" name="maxRecharge" placeholder="最大" style="width:80px" value="{{$maxRecharge}}">
+                                    &nbsp;&nbsp;
+
+                                    <input type="submit" class="btn btn-sm btn-gradient-dark btn-icon-text" value="{{ __('auto.搜索') }}"/>&nbsp;&nbsp;
+                                    <a href="/admin/global/user_new_list" class="btn btn-sm btn-gradient-warning btn-icon-text">{{ __('auto.清空') }}</a>&nbsp;&nbsp;
+                                    <a href="/admin/global/user_new_list?excel=1&GameID={{$gameID}}&start_time={{$startTime}}&end_time={{$endTime}}&lstart_time={{$lstartTime}}&lend_time={{$lendTime}}&channel={{$channel}}&minRecharge={{$minRecharge}}&maxRecharge={{$maxRecharge}}"
+                                       class="btn btn-sm btn-gradient-light btn-icon-text">{{ __('auto.导出') }}</a>
+                                </div>
+                            </form>
+
+                            <table class="table table-bordered">
+                                <thead>
+                                <tr>
+                                    <th width="6%">UserID</th>
+                                    <th width="6%">{{ __('auto.会员') }}ID</th>
+                                    <th width="8%">{{ __('auto.昵称') }}</th>
+                                    <th width="8%">{{ __('auto.余额') }}</th>
+                                    <th width="6%">{{ __('auto.状态') }}</th>
+                                    <th width="10%">{{ __('auto.上次离线时间') }}</th>
+                                    <th width="10%">{{ __('auto.注册日期') }}</th>
+                                    <th width="6%">{{ __('auto.渠道名称') }}</th>
+                                    <th width="8%">{{ __('auto.手机号') }}</th>
+                                    <th width="8%">充值</th>
+                                    <th width="8%">提现</th>
+                                    <th width="8%">总输赢</th>
+                                    <th width="6%">{{ __('auto.设置') }}</th>
+                                </tr>
+                                </thead>
+                                <tbody>
+                                @foreach($list as $k=>$item)
+                                    <tr>
+                                        <td>{{$item->UserID}}</td>
+                                        <td>
+                                            <a href="/admin/global/id_find?UserID={{$item->UserID}}">
+                                                {{$item->GameID}}
+                                            </a>
+                                        </td>
+                                        <td>{{$item->NickName}}</td>
+                                        <td>{{$item->Score}}</td>
+                                        <td>{{$item->Nullity}}</td>
+                                        <td>{{ $item->LastLogonDate ? date('Y-m-d H:i:s', strtotime($item->LastLogonDate)) : '' }}</td>
+                                        <td>{{ $item->RegisterDate ? date('Y-m-d H:i:s', strtotime($item->RegisterDate)) : '' }}</td>
+                                        <td>{{$item->Channel}}</td>
+                                        <td>{{$item->PhoneNum}}</td>
+                                        <td>{{$item->Recharge ?? 0}}</td>
+                                        <td>{{$item->Withdraw ?? 0}}</td>
+                                        <td>{{$item->totalScore ?? 0}}</td>
+                                        <td>
+                                            <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="update({{$item->UserID}})">
+                                                {{ __('auto.修改') }}
+                                                <i class="mdi mdi-file-check btn-icon-append"></i>
+                                            </button>
+                                        </td>
+                                    </tr>
+                                @endforeach
+                                </tbody>
+                            </table>
+                        </div>
+                        <div class="box-footer clearfix" id="pages">
+                            {{ __('auto.总共') }} <b>{{ $list->appends([
+                                    'GameID'=>$gameID,
+                                    'start_time'=>$startTime,
+                                    'end_time'=>$endTime,
+                                    'lstart_time'=>$lstartTime,
+                                    'lend_time'=>$lendTime,
+                                    'channel'=>$channel,
+                                    'minRecharge'=>$minRecharge,
+                                    'maxRecharge'=>$maxRecharge,
+                                ])->total() }}</b> {{ __('auto.条,分为') }}<b>{{ $list->lastPage() }}</b>{{ __('auto.页') }}
+                            {!! $list->links() !!}
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <script>
+        function start_times(id) {
+            getFormat('00', '00', '00');
+            document.getElementById(id).value = format
+        }
+
+        function end_times(id) {
+            getFormat('23', '59', '59');
+            document.getElementById(id).value = format
+        }
+
+        function update(id) {
+            var page = layer.open({
+                type: 2,
+                title: '{{ __('auto.修改配置') }}',
+                shadeClose: true,
+                shade: 0.8,
+                area: ['70%', '90%'],
+                content: '/admin/global/user_update?id=' + id
+            });
+        }
+    </script>
+@endsection

+ 1 - 0
routes/web.php

@@ -444,6 +444,7 @@ Route::group([
         /*             用户管理             */
         //用户列表
         $route->any('/global/userlist', 'Admin\GlobalController@userlist');
+        $route->any('/global/user_new_list', 'Admin\GlobalController@userNewList');
         //用户列表 修改视图页面
         $route->any('/global/user_update', 'Admin\GlobalController@user_update');
         //用户列表 封号,解封操作