Browse Source

1、点击图权重配置移到routes
2、客服控制列表

Tree 10 hours ago
parent
commit
11f9a0b1c7

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

@@ -595,6 +595,21 @@ class GlobalController extends Controller
         ));
     }
 
+    public function rechargeRank(Request $request)
+    {
+        $adminChannels = session('admin_channels');
+        $channel = $request->channel;
+        $channels = $adminChannels;
+
+        $list = (new GlobalUser())->rechargeRankList($channel);
+
+        $page = \Illuminate\Pagination\Paginator::resolveCurrentPage('page');
+
+        return view('admin.global.recharge_rank', compact(
+            'list', 'channel', 'channels', 'page'
+        ));
+    }
+
     //用户列表
     public function userlist1(Request $request)
     {

+ 0 - 6
app/Http/Controllers/Api/WeightConfigController.php

@@ -35,12 +35,6 @@ class WeightConfigController extends Controller
         return $result;
     }
 
-    public function getWeights(Request $request)
-    {
-        $config = self::getConfig();
-        return apiReturnSuc($config);
-    }
-
     public function clickRecord(Request $request)
     {
         $id = intval($request->input('id'));

+ 3 - 0
app/Http/Controllers/Game/WebRouteController.php

@@ -20,6 +20,7 @@ use App\Game\Style;
 use App\Game\WebChannelConfig;
 use App\Game\WebRegionConfig;
 use App\Http\Controllers\Api\ApiController;
+use App\Http\Controllers\Api\WeightConfigController;
 use App\Http\Controllers\Controller;
 use App\Http\helper\NumConfig;
 use App\IpLocation;
@@ -314,6 +315,8 @@ class WebRouteController extends Controller
             'sharePop' => $sharePop,
             's_k' => $this->quickLoad($spe_key, $user['UserID']??0, $FPID, $FF, $request->input('cookie', ''))??'',
 
+            'weight1234' => WeightConfigController::getConfig(),
+
         ];
 
 

+ 82 - 0
app/Services/GlobalUser.php

@@ -572,6 +572,88 @@ class GlobalUser extends BaseApiLogic
         return $list;
     }
 
+    /**
+     * 充值排行榜:总充值>100 且 提现/充值<35%
+     */
+    public function rechargeRankList($channel)
+    {
+        $AccountsInfoM = new AccountsInfo();
+        $minRecharge = 100;
+
+        $field = [
+            'ai.GameID', 'ai.UserID', 'ai.NickName', 'ai.Channel',
+            'ai.RegisterDate', 'ai.LastLogonDate',
+            'gi.Score',
+            'rut.Recharge', 'rut.Withdraw',
+        ];
+        $Sql = DB::connection('read')->table(TableName::QPAccountsDB() . 'AccountsInfo as ai')
+            ->join(TableName::QPRecordDB() . 'RecordUserTotalStatistics as rut', 'ai.UserID', 'rut.UserID')
+            ->leftJoin(TableName::QPTreasureDB() . 'GameScoreInfo as gi', 'ai.UserID', 'gi.UserID')
+            ->where('ai.IsAndroid', 0)
+            ->where('rut.Recharge', '>', $minRecharge)
+            ->whereRaw('rut.Withdraw * 1.0 / (rut.Recharge * ' . NumConfig::NUM_VALUE . ') < 0.35')
+            ->select($field);
+
+        if (!empty($channel) || $channel === '0') {
+            $Sql->where('ai.Channel', $channel);
+        }
+
+        $adminChannels = session('admin_channels');
+        if (count($adminChannels) < 5) {
+            $Sql->whereIn('ai.Channel', $adminChannels);
+        }
+
+        $list = $Sql->orderByRaw('rut.Recharge desc')->paginate(15);
+
+        $UserIDs = [];
+        foreach ($list as $value) {
+            $UserIDs[] = $value->UserID;
+        }
+
+        $today = !empty($UserIDs) ? $AccountsInfoM->accountTodayStatistics($UserIDs) : [];
+
+        $controlLabel = !empty($UserIDs) ? $AccountsInfoM->controlLabel($UserIDs) : [];
+
+        $UserScoreControls = !empty($UserIDs)
+            ? DB::table(TableName::QPTreasureDB() . 'UserScoreControl')
+                ->whereIn('UserID', $UserIDs)
+                ->select(['ControlRadian', 'ControlScore', 'EffectiveScore', 'UserID'])
+                ->get()
+            : collect();
+
+        $controlModel = new Control();
+
+        foreach ($list as &$value) {
+            $value->Score = ($value->Score ?? 0) / NumConfig::NUM_VALUE;
+            $recharge = $value->Recharge ?? 0;
+            $withdraw = ($value->Withdraw ?? 0) / NumConfig::NUM_VALUE;
+            $value->Recharge = $recharge;
+            $value->Withdraw = $withdraw;
+            $value->withdrawRate = $recharge > 0 ? round($withdraw / $recharge * 100, 2) : 0;
+
+            $value->todayRecharge = 0;
+            $value->todayWithdraw = 0;
+            foreach ($today as $val) {
+                if ($val->UserID == $value->UserID) {
+                    $value->todayRecharge = $val->Recharge;
+                    $value->todayWithdraw = $val->Withdraw / NumConfig::NUM_VALUE;
+                }
+            }
+
+            $value->RecordRechargeControl = isset($controlLabel[$value->UserID]) ? 1 : 0;
+            $value->ControlScore = null;
+            $value->EffectiveScore = null;
+            $value->control_record = $controlModel->getControlState($value->UserID, []);
+            foreach ($UserScoreControls as $val) {
+                if ($val->UserID == $value->UserID) {
+                    $value->EffectiveScore = number_float($val->EffectiveScore / NumConfig::NUM_VALUE);
+                    $value->ControlScore = number_float($val->ControlScore / NumConfig::NUM_VALUE);
+                }
+            }
+        }
+        return $list;
+    }
+
     // 全局报表 - 用户相关
     public function accounts()
     {

+ 131 - 0
resources/views/admin/global/recharge_rank.blade.php

@@ -0,0 +1,131 @@
+@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-trophy"></i>
+                    </span>
+                    充值排行榜
+                </h3>
+                <nav aria-label="breadcrumb">
+                    <ol class="breadcrumb">
+                        <li class="breadcrumb-item"><a href="#">{{ __('auto.用户数据') }}</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">充值排行榜 <small style="color:#999">(总充值 &gt; 100 且 提现/充值 &lt; 35%)</small></h4>
+                            <form class="well form-inline margin-top-20" method="get" action="/admin/global/recharge_rank">
+                                <div>
+                                    <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;
+
+                                    <input type="submit" class="btn btn-sm btn-gradient-dark btn-icon-text" value="{{ __('auto.搜索') }}"/>&nbsp;&nbsp;
+                                    <a href="/admin/global/recharge_rank" class="btn btn-sm btn-gradient-warning btn-icon-text">{{ __('auto.清空') }}</a>
+                                </div>
+                            </form>
+
+                            <table class="table table-bordered">
+                                <thead>
+                                <tr>
+                                    <th width="6%">{{ __('auto.会员') }}ID</th>
+                                    <th width="5%">{{ __('auto.渠道') }}</th>
+                                    <th width="7%">{{ __('auto.余额') }}</th>
+                                    <th width="7%">今日充值</th>
+                                    <th width="7%">今日提现</th>
+                                    <th width="8%">总充值</th>
+                                    <th width="8%">总提现</th>
+                                    <th width="6%">提/充比</th>
+                                    <th width="10%">{{ __('auto.注册时间') }}</th>
+                                    <th width="10%">最后登录时间</th>
+                                    <th width="10%">{{ __('auto.控制状态') }}</th>
+                                    <th width="8%">{{ __('auto.用户控制') }}</th>
+                                </tr>
+                                </thead>
+                                <tbody>
+                                @foreach($list as $item)
+                                    <tr>
+                                        <td>
+                                            <a href="/admin/global/id_find?UserID={{$item->UserID}}">
+                                                {{$item->GameID}}
+                                            </a>
+                                        </td>
+                                        <td>{{$item->Channel}}</td>
+                                        <td>{{$item->Score}}</td>
+                                        <td>{{$item->todayRecharge ?? 0}}</td>
+                                        <td>{{$item->todayWithdraw ?? 0}}</td>
+                                        <td>{{$item->Recharge}}</td>
+                                        <td>{{$item->Withdraw}}</td>
+                                        <td>{{$item->withdrawRate}}%</td>
+                                        <td>{{ $item->RegisterDate ? date('Y-m-d H:i:s', strtotime($item->RegisterDate)) : '' }}</td>
+                                        <td>{{ $item->LastLogonDate ? date('Y-m-d H:i:s', strtotime($item->LastLogonDate)) : '' }}</td>
+                                        <td>
+                                            @if ($item->RecordRechargeControl == 1)
+                                                {{ __('auto.自动控制') }} <br>
+                                            @endif
+
+                                            @empty($item->ControlScore)
+                                                {{ __('auto.无') }}
+                                            @elseif ($item->ControlScore < 0)
+                                                {{ __('auto.单控中') }} {{$item->EffectiveScore}} / {{$item->ControlScore}}
+                                                / {{$item->control_record}} {{ __('auto.输') }}
+                                            @elseif ($item->ControlScore > 0)
+                                                {{ __('auto.单控中') }} {{ __('auto.赢') }}{{$item->EffectiveScore}} / {{$item->ControlScore}}
+                                                {{$item->control_record}}
+                                            @endempty
+                                        </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([
+                                    'channel' => $channel,
+                                ])->total() }}</b> {{ __('auto.条,分为') }}<b>{{ $list->lastPage() }}</b>{{ __('auto.页') }}
+                            {!! $list->links() !!}
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <script>
+        function update(id) {
+            var page = layer.open({
+                type: 2,
+                title: '{{ __('auto.修改配置') }}',
+                shadeClose: true,
+                shade: 0.8,
+                offset: '180px',
+                scrollbar: false,
+                maxmin: true,
+                area: ['70%', '60%'],
+                fixed: false,
+                content: '/admin/global/dk_userlist_edit?UserID=' + id,
+                end: function () {
+                    window.location.reload();
+                },
+            });
+        }
+    </script>
+@endsection

+ 0 - 1
routes/api.php

@@ -41,7 +41,6 @@ Route::any('/rate_us', 'Api\ApiController@rateUs');
 Route::any('/apk/cconfig', 'Api\AutoApkController@channelConfig');
 Route::any('/apk/jump', 'Api\AutoApkController@jumpApkByConfig');
 
-Route::any('/weight_config/get', 'Api\WeightConfigController@getWeights');
 Route::any('/weight_config/click', 'Api\WeightConfigController@clickRecord');
 
 Route::group([

+ 1 - 0
routes/web.php

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