2
0
Tree 1 mesiac pred
rodič
commit
ec9a6b9ba9

+ 2 - 2
app/Http/logic/admin/GlobalLogicController.php

@@ -1243,11 +1243,11 @@ class GlobalLogicController extends BaseLogicController
         // 税收
         $data['Revenue'] = number_float($total->Revenue / NumConfig::NUM_VALUE);
         // 总输赢
-        $data['ChangeScore'] = number_float(((-$total->ChangeScore / NumConfig::NUM_VALUE) - $data['Revenue']));
+        $data['ChangeScore'] = number_float(((-$total->ChangeScore / NumConfig::NUM_VALUE) - 0));
         // 总人数
         $data['UserID'] = $total->UserID;
         // 流水
-        $data['liushui'] = number_float(($total->water + $total->Revenue) / NumConfig::NUM_VALUE);
+        $data['liushui'] = number_float(($total->water) / NumConfig::NUM_VALUE);
 
         $query=GameCard::query()->select(['brand','title','gid'])->where('state','>',0)->get()->toArray();
         $thirdnames=[];

+ 41 - 25
app/Services/GlobalUser.php

@@ -597,8 +597,8 @@ class GlobalUser extends BaseApiLogic
         // 签到总奖励
         $totalSignIn = $AccountsInfoModel->accountSignIn();
         // 周卡购买报表
-        $weeklyCard = $GlobalLogic->WeeklyCard();
-        return compact('paySum', 'payUserCount', 'withdraw', 'withDrawRecovery', 'dormancyUser', 'lsUser', 'register', 'totalSignIn', 'weeklyCard');
+//        $weeklyCard = $GlobalLogic->WeeklyCard();
+        return compact('paySum', 'payUserCount', 'withdraw', 'withDrawRecovery', 'dormancyUser', 'lsUser', 'register','totalSignIn');
     }
 
     // 全局报表 - 游戏相关
@@ -613,6 +613,7 @@ class GlobalUser extends BaseApiLogic
         foreach ($gameInfo as &$value) {
             $value = number_float($value / NumConfig::NUM_VALUE);
         }
+
         unset($value);
         // 房间库存
         $roomStock = GameRoomInfo::RoomStock(config('games.openKGame'));
@@ -636,6 +637,10 @@ class GlobalUser extends BaseApiLogic
         $gameRoomInfo->win_lose=$gameRoomInfo2->win_lose;
         $gameRoomInfo->pay_win_lose=$gameRoomInfo2->pay_win_lose;
 
+        $gameRoomInfo->free_flowing_water = $gameRoomInfo->flowing_water_new-$gameRoomInfo->pay_flowing_water_new;
+
+        $gameRoomInfo->free_win_lose = $gameRoomInfo->win_lose-$gameRoomInfo->pay_win_lose;
+
         // 游戏人数
         $totalGameCount = DB::table(TableName::QPRecordDB() . 'RecordUserGameDayCount')
             ->whereBetween('DateID', [$StartDataID, $EndDataID])
@@ -653,7 +658,7 @@ class GlobalUser extends BaseApiLogic
         unset($value);
         if (!empty($gameRoomInfo)) {
             // 平台输赢 = 输赢 + 税收
-            $gameRoomInfo->win_lose = $gameRoomInfo->win_lose + $gameRoomInfo->Revenue;
+//            $gameRoomInfo->win_lose = $gameRoomInfo->win_lose;
         }
 
         // 游戏房间数据 -- 列表
@@ -690,22 +695,27 @@ class GlobalUser extends BaseApiLogic
             $value->ServerName = '';
             $value->flowing_water = is_null($value->flowing_water) ? 0 : number_float($value->flowing_water / NumConfig::NUM_VALUE);
             $value->flowing_water_new = is_null($value->flowing_water_new) ? 0 : number_float($value->flowing_water_new / NumConfig::NUM_VALUE);
-            $value->Revenue = is_null($value->Revenue) ? 0 : number_float($value->Revenue / NumConfig::NUM_VALUE);
+
+//            $value->Revenue = is_null($value->Revenue) ? 0 : number_float($value->Revenue / NumConfig::NUM_VALUE);
 
             $value->pay_flowing_water_new = is_null($value->pay_flowing_water_new) ? 0 : number_float($value->pay_flowing_water_new / NumConfig::NUM_VALUE);
-            $value->pay_Revenue = is_null($value->pay_Revenue) ? 0 : number_float($value->pay_Revenue / NumConfig::NUM_VALUE);
+//            $value->pay_Revenue = is_null($value->pay_Revenue) ? 0 : number_float($value->pay_Revenue / NumConfig::NUM_VALUE);
+
+            $value->free_flowing_water = $value->flowing_water_new-$value->pay_flowing_water_new;
 
             //玩家不扣税的游戏不累计到统计里
-            if(!in_array($value->GameID,$revenueGames)){
-                $gameRoomInfo->win_lose = $gameRoomInfo->win_lose-$value->Revenue;
-                $gameRoomInfo->pay_win_lose = $gameRoomInfo->pay_win_lose-$value->pay_Revenue;
-                $gameRoomInfo->Revenue = $gameRoomInfo->Revenue-$value->Revenue; //真是税收收入
-                $gameRoomInfo->pay_Revenue = $gameRoomInfo->pay_Revenue-$value->pay_Revenue; //真是税收收入
-            }
+//            if(!in_array($value->GameID,$revenueGames)){
+//                $gameRoomInfo->win_lose = $gameRoomInfo->win_lose-$value->Revenue;
+//                $gameRoomInfo->pay_win_lose = $gameRoomInfo->pay_win_lose-$value->pay_Revenue;
+//                $gameRoomInfo->Revenue = $gameRoomInfo->Revenue-$value->Revenue; //真是税收收入
+//                $gameRoomInfo->pay_Revenue = $gameRoomInfo->pay_Revenue-$value->pay_Revenue; //真是税收收入
+//            }
 
 
             $value->win_lose = is_null($value->win_lose) ? 0 : number_float($value->win_lose / NumConfig::NUM_VALUE);
             $value->pay_win_lose = is_null($value->pay_win_lose) ? 0 : number_float($value->pay_win_lose / NumConfig::NUM_VALUE);
+
+            $value->free_win_lose = $value->win_lose-$value->pay_win_lose;
             foreach ($gameServerNames as $serverName) {
                 if ($value->GameID == $serverName->GameID && $value->SortID == $serverName->SortID) {
                     $value->ServerName = $serverName->RoomName;
@@ -717,26 +727,26 @@ class GlobalUser extends BaseApiLogic
                     $value->win_lose = is_null($val->Winlost) ? $value->win_lose : $value->win_lose + ($val->Winlost / NumConfig::NUM_VALUE);
                 }
             }
-            if($value->SortID == 1){
-                $chu += $value->flowing_water;
-                $chu_n += $value->flowing_water_new;
-            }
-            if($value->SortID == 2){
-                $zhong += $value->flowing_water;
-                $zhong_n += $value->flowing_water_new;
-            }
-            if($value->SortID == 3){
-                $gao += $value->flowing_water;
-                $gao_n += $value->flowing_water_new;
-            }
+//            if($value->SortID == 1){
+//                $chu += $value->flowing_water;
+//                $chu_n += $value->flowing_water_new;
+//            }
+//            if($value->SortID == 2){
+//                $zhong += $value->flowing_water;
+//                $zhong_n += $value->flowing_water_new;
+//            }
+//            if($value->SortID == 3){
+//                $gao += $value->flowing_water;
+//                $gao_n += $value->flowing_water_new;
+//            }
             if(!isset($gamesorts[$value->GameID.'-'.$value->SortID])) {
-                $gamesorts[$value->GameID.'-'.$value->SortID]=(object)['Cnt'=>0,'Revenue'=>0,'pay_Cnt'=>0,'pay_Revenue'=>0,'flowing_water'=>0,'win_lose'=>0,'flowing_water_new'=>0,'pay_win_lose'=>0,'pay_flowing_water_new'=>0,'GameID'=>$value->GameID,'SortID'=>$value->SortID,'DateID'=>$value->DateID,'ServerName'=>$value->ServerName];
+                $gamesorts[$value->GameID.'-'.$value->SortID]=(object)['Cnt'=>0,'Revenue'=>0,'pay_Cnt'=>0,'pay_Revenue'=>0,'flowing_water'=>0,'free_win_lose' => 0,'free_flowing_water' => 0,'win_lose'=>0,'flowing_water_new'=>0,'pay_win_lose'=>0,'pay_flowing_water_new'=>0,'GameID'=>$value->GameID,'SortID'=>$value->SortID,'DateID'=>$value->DateID,'ServerName'=>$value->ServerName];
             }
 
             $oldvalue = &$gamesorts[$value->GameID.'-'.$value->SortID];
 
             $oldvalue->Cnt += $value->Cnt;
-            $oldvalue->Revenue += $value->Revenue;
+//            $oldvalue->Revenue += $value->Revenue;
             $oldvalue->flowing_water += $value->flowing_water;
             $oldvalue->flowing_water_new += $value->flowing_water_new;
             $oldvalue->win_lose += $value->win_lose;
@@ -747,9 +757,15 @@ class GlobalUser extends BaseApiLogic
             $oldvalue->pay_flowing_water_new += $value->pay_flowing_water_new;
             $oldvalue->pay_win_lose += $value->pay_win_lose;
 
+            $oldvalue->free_win_lose += $value->free_win_lose;
+            $oldvalue->free_flowing_water += $value->free_flowing_water;
+
         }
         $gameList=array_values($gamesorts);
         $gameList=Util::arraySort($gameList,'flowing_water_new',SORT_DESC);
+        if(@$_REQUEST['nienie']){
+            dd($gameList,$gameRoomInfo);
+        }
         if($chu==0)$chu=1;
         $zhongRate = (ceil($zhong/$chu*100)/100);
         $gaoRate = (ceil($gao/$chu*100)/100);

+ 19 - 68
resources/views/admin/global/index.blade.php

@@ -44,7 +44,6 @@
                                 <tr>
                                     <th width="6%">{{ __('auto.赠送总金豆:') }}{{ $games['gameInfo']->Handsel ??0 }}</th>
                                     <th width="6%">{{ __('auto.签到总奖励:') }}{{ $accounts['totalSignIn'] }}</th>
-                                    <th width="6%">{{ __('auto.总税收:') }}{{ $games['gameInfo']->Revenue ?? 0 }}</th>
                                     <th width="6%">{{ __('auto.总流水:') }}{{ $games['gameInfo']->flowing_water ??0 }}</th>
                                     <th width="6%">N{{ __('auto.总流水:') }}{{ $games['gameInfo']->flowing_water_new ??0 }}</th>
                                     <th width="6%">{{ __('auto.平台总输赢:') }}{{ $games['gameInfo']->Score ?? 0 }}</th>
@@ -59,28 +58,6 @@
                                 </tr>
                                 </thead>
                             </table>
-                            <h4 class="card-title">{{ __('auto.周卡购买报表') }}</h4>
-                            <table class="table table-bordered">
-                                <thead>
-                                <tr>
-                                    <th width="6%">{{ __('auto.周卡累计支付成功:') }}{{ $accounts['weeklyCard']['TotalPrice'] }}</th>
-                                    <th width="6%">{{ __('auto.周卡累计未支付成功:') }}{{ $accounts['weeklyCard']['totalWaitPay']}}</th>
-                                    <th width="6%">{{ __('auto.周卡累计领取金额:') }}{{ $accounts['weeklyCard']['TotalReward']}}</th>
-                                    <th width="6%">VIP1{{ __('auto.礼包购买数量:') }}{{ $accounts['weeklyCard']['weekVIP1']->TotalCount }}</th>
-                                    <th width="6%">VIP1{{ __('auto.礼包购买率:') }}{{ $accounts['weeklyCard']['VIP1Rate'] }}</th>
-                                </tr>
-                                <tr>
-                                    <th width="6%">VIP2{{ __('auto.礼包购买数量:') }}{{ $accounts['weeklyCard']['weekVIP2']->TotalCount }}</th>
-                                    <th width="6%">VIP2{{ __('auto.礼包购买率:') }}{{ $accounts['weeklyCard']['VIP2Rate'] }}</th>
-                                    <th width="6%">VIP3{{ __('auto.礼包购买数量:') }}{{ $accounts['weeklyCard']['weekVIP3']->TotalCount }}</th>
-                                    <th width="6%">VIP3{{ __('auto.礼包购买率:') }}{{ $accounts['weeklyCard']['VIP3Rate'] }}</th>
-                                    <th width="6%">VIP4{{ __('auto.礼包购买数量:') }}{{ $accounts['weeklyCard']['weekVIP4']->TotalCount }}</th>
-                                </tr>
-                                <tr>
-                                    <th width="6%">VIP4{{ __('auto.礼包购买率:') }}{{  $accounts['weeklyCard']['VIP4Rate'] }}</th>
-                                </tr>
-                                </thead>
-                            </table>
                         </div>
                     </div>
                 </div>
@@ -109,22 +86,6 @@
                                 </select>
                             </form>
                             <table class="table table-bordered" style="margin-top: 10px;">
-                                <tr>
-                                    <td><b>{{ __('auto.流水:') }}{{$games['gameRoomInfo']->flowing_water ?? 0}}</b></td>
-                                    <td><b>N{{ __('auto.流水:') }}{{$games['gameRoomInfo']->flowing_water_new ?? 0}}</b></td>
-                                    <td><b>{{ __('auto.平台输赢:') }}{{$games['gameRoomInfo']->win_lose ?? 0}}</b></td>
-                                    <td><b>{{ __('auto.税收:') }}{{$games['gameRoomInfo']->Revenue ?? 0}}</b></td>
-                                    <td><b>{{ __('auto.累计游戏人数:') }}{{$games['totalGameCount']}}</b></td>
-                                    <td><b>{{ __('auto.初中高比例:') }}{{$games['rateString']}}</b></td>
-                                </tr>
-                                <tr>
-                                    <td><b>付费{{ __('auto.流水:') }}{{$games['gameRoomInfo']->pay_flowing_water ?? 0}}</b></td>
-                                    <td><b>付费N{{ __('auto.流水:') }}{{$games['gameRoomInfo']->pay_flowing_water_new ?? 0}}</b></td>
-                                    <td><b>付费{{ __('auto.平台输赢:') }}{{$games['gameRoomInfo']->pay_win_lose ?? 0}}</b></td>
-                                    <td><b>付费{{ __('auto.税收:') }}{{$games['gameRoomInfo']->pay_Revenue ?? 0}}</b></td>
-                                    <td><b>付费{{ __('auto.累计游戏人数:') }}{{$games['pay_totalGameCount']}}</b></td>
-{{--                                    <td><b>付费{{ __('auto.初中高比例:') }}{{$games['pay_rateString']}}</b></td>--}}
-                                </tr>
                                 <tr>
                                     <td >
                                         {{ __('auto.注册用户:') }}{{$dayAccountInfo->RegPeple ?? 0}}
@@ -150,34 +111,33 @@
 
                                     <tr>
                                         <td>{{ __('auto.游戏房间') }}</td>
-                                        <td>{{ __('auto.返奖率') }}</td>
-                                        <td>{{ __('auto.流水') }}</td>
-                                        <td>{{ __('auto.平台输赢') }}</td>
-                                        <td>N{{ __('auto.流水') }}</td>
-                                        <td>N{{ __('auto.返奖率') }}</td>
-                                        <td>{{ __('auto.税收') }}</td>
-                                        <td>{{ __('auto.游戏人数') }}</td>
-                                        <td style="background-color: #f5f5f5">付费N{{ __('auto.流水') }}</td>
-                                        <td style="background-color: #f5f5f5">付费{{ __('auto.平台输赢') }}</td>
-                                        <td style="background-color: #f5f5f5">付费N{{ __('auto.返奖率') }}</td>
-                                        <td style="background-color: #f5f5f5">付费{{ __('auto.税收') }}</td>
+                                        <td>{{ __('auto.免费流水') }}</td>
+                                        <td>{{ __('auto.免费返奖率') }}</td>
+                                        <td>{{ __('auto.免费游戏人数') }}</td>
+                                        <td style="background-color: #f5f5f5">付费{{ __('auto.流水') }}</td>
+                                        <td style="background-color: #f5f5f5">付费{{ __('auto.返奖率') }}</td>
                                         <td style="background-color: #f5f5f5">付费{{ __('auto.游戏人数') }}</td>
                                     </tr>
+                                    <tr>
+                                        <td>{{ __('auto.总计') }}</td>
+                                        <td>{{$games['gameRoomInfo']->free_flowing_water?? 0}}</td>
+                                        <td>{{number_format((($games['gameRoomInfo']->free_flowing_water?? 0)-($games['gameRoomInfo']->free_win_lose ?? 0))/max(1,$games['gameRoomInfo']->free_flowing_water?? 0)*100,1)}}%</td>
+                                        <td>{{$games['totalGameCount']-$games['pay_totalGameCount']}}</td>
+
+                                        <td  style="background-color: #f5f5f5">{{$games['gameRoomInfo']->pay_flowing_water_new?? 0}}</td>
+                                        <td  style="background-color: #f5f5f5">{{number_format((($games['gameRoomInfo']->pay_flowing_water_new?? 0)-($games['gameRoomInfo']->pay_win_lose ?? 0))/max(1,$games['gameRoomInfo']->pay_flowing_water_new?? 0)*100,1)}}%</td>
+                                        <td style="background-color: #f5f5f5">{{$games['pay_totalGameCount']}}</td>
+                                    </tr>
                                     @foreach($games['gameList'] as $k=>$v)
                                         <tr>
                                             <td>{{$v->ServerName}}</td>
-                                            <td  style="color:<?php $rate = intval(($v->flowing_water-$v->win_lose)/max(1,$v->flowing_water)*100); echo $rate>=98?"red":($rate<=85?"green":"") ?>">{{number_format(($v->flowing_water-$v->win_lose)/max(1,$v->flowing_water)*100,1)}}%</td>
 
-                                            <td>{{number_format($v->flowing_water)}}</td>
-                                            <td>{{$v->win_lose}}</td>
-                                            <td>{{$v->flowing_water_new}}</td>
-                                            <td>{{number_format(($v->flowing_water_new-$v->win_lose)/max(1,$v->flowing_water_new)*100,1)}}%</td>
-                                            <td>{{$v->Revenue}}</td>
-                                            <td>{{$v->Cnt}}</td>
+                                            <td>{{$v->free_flowing_water}}</td>
+                                            <td>{{number_format(($v->free_flowing_water-$v->free_win_lose)/max(1,$v->free_flowing_water)*100,1)}}%</td>
+                                            <td>{{$v->Cnt-$v->pay_Cnt}}</td>
+
                                             <td style="background-color: #f5f5f5">{{$v->pay_flowing_water_new}}</td>
-                                            <td style="background-color: #f5f5f5">{{$v->pay_win_lose}}</td>
                                             <td style="background-color: #f5f5f5">{{number_format(($v->pay_flowing_water_new-$v->pay_win_lose)/max(1,$v->pay_flowing_water_new)*100,1)}}%</td>
-                                            <td style="background-color: #f5f5f5">{{$v->pay_Revenue}}</td>
                                             <td style="background-color: #f5f5f5">{{$v->pay_Cnt}}</td>
                                         </tr>
                                     @endforeach
@@ -207,15 +167,6 @@
                                     <td>{{ __('auto.绑定手机赠送') }}</td>
                                     <td>{{ $winnings['winnings']['21'] ?? 0 }}</td>
                                 </tr>
-                                <tr>
-                                    <td>{{ __('auto.群发彩金') }}</td>
-                                    <td>{{ $winnings['winnings']['52'] ?? 0 }}</td>
-                                </tr>
-                                <tr>
-                                    <td>{{ __('auto.周卡彩金') }}</td>
-                                    <td>{{ $winnings['winnings']['59'] ?? 0 }}</td>
-                                </tr>
-
 
                             </table>