Procházet zdrojové kódy

支付费率校准 展示

Tree před 4 hodinami
rodič
revize
8f58bbb8e0

+ 5 - 2
app/Http/Controllers/Admin/RechargeController.php

@@ -172,13 +172,14 @@ class RechargeController extends Controller
 
         $order ? $orderby = 'g.price desc' : $orderby = 'sum(o.amount) desc';
 
-        // 充值总金额
+        // 充值总金额、手续费汇总(管理员可见)
         $payTotalMoney = DB::connection('write')->table('agent.dbo.order as o')
             ->leftJoin('QPAccountsDB.dbo.AccountsInfo as ai', 'o.user_id', '=', 'ai.UserID')
             ->lock('with(nolock)')
-            ->where($where)->selectRaw('sum(amount) as amount,count(distinct(user_id)) count_u,count(id) count_id')->first();
+            ->where($where)->selectRaw('sum(amount) as amount,sum(ISNULL(payment_fee,0)) as total_payment_fee,count(distinct(user_id)) count_u,count(id) count_id')->first();
 
         $totalMoney = isset($payTotalMoney->amount) ? number_float($payTotalMoney->amount / NumConfig::NUM_VALUE) : 0;
+        $totalPaymentFee = isset($payTotalMoney->total_payment_fee) ? number_float($payTotalMoney->total_payment_fee / NumConfig::NUM_VALUE) : 0;
 
         // 已到账
         if ($recharge_type == 1) {
@@ -249,6 +250,7 @@ class RechargeController extends Controller
                 $val->amount = number_float($val->amount / NumConfig::NUM_VALUE);
                 $val->after_amount = number_float($val->after_amount / NumConfig::NUM_VALUE);
                 $val->score = number_float($val->score / NumConfig::NUM_VALUE);
+                $val->payment_fee = number_float(($val->payment_fee ?? 0) / NumConfig::NUM_VALUE);
 
                 $val->MaxScore = number_float($val->MaxScore / NumConfig::NUM_VALUE);
 
@@ -308,6 +310,7 @@ class RechargeController extends Controller
                 'type_list' => $type_list,
                 'recharge_type' => $recharge_type,
                 'totalMoney' => $totalMoney,
+                'totalPaymentFee' => $totalPaymentFee,
                 'overMoney' => $overMoney,
                 'payOverMoney' => $payOverMoney ?? 0,
                 'payTotalMoney' => $payTotalMoney,

+ 2 - 0
app/Http/Controllers/Admin/WithdrawalController.php

@@ -177,6 +177,8 @@ class WithdrawalController extends BaseController
             ->where('type', 'cash')
             ->get();
         $list['request'] = $request;
+        $admin = session('admin');
+        $list['viewAll'] = $admin && isset($admin->roles[0]->id) && in_array($admin->roles[0]->id, [1, 12, 2010, 2011]) ? 1 : 0;
         return view('admin.Withdrawal.verify_finish', $list);
     }
 

+ 8 - 2
app/Http/logic/admin/WithdrawalLogic.php

@@ -157,9 +157,10 @@ class WithdrawalLogic extends BaseLogicController
             AccountWithDrawInfo::orderOverDownExcel($SQL, $where);
 
         } else {
-            $field = ['ai.RegisterIP','ow.locking', 'ar.remarks','ow.remark', 'ow.RecordID', 'ar.RecordID as ar_RecordID', 'wn.state as wn_state', 'ai.NickName', 'ow.AccountsBank', 'ow.BankUserName', 'ow.WithDraw', 'ow.State', 'ow.BankNO', 'ow.ServiceFee', 'OrderId', 'ai.GameID', 'ai.UserID', 'ai.Channel', 'ar.admin_id', 'ow.agent', 'finishDate', 'PixNum', 'PixType', 'ow.EmailAddress', 'ow.PhoneNumber', 'ow.AdhaarNumber', 'ow.IFSCNumber'];
+            $field = ['ai.RegisterIP','ow.locking', 'ar.remarks','ow.remark', 'ow.RecordID', 'ar.RecordID as ar_RecordID', 'wn.state as wn_state', 'ai.NickName', 'ow.AccountsBank', 'ow.BankUserName', 'ow.WithDraw', 'ow.State', 'ow.BankNO', 'ow.ServiceFee', 'ow.withdraw_fee', 'OrderId', 'ai.GameID', 'ai.UserID', 'ai.Channel', 'ar.admin_id', 'ow.agent', 'finishDate', 'PixNum', 'PixType', 'ow.EmailAddress', 'ow.PhoneNumber', 'ow.AdhaarNumber', 'ow.IFSCNumber'];
             $SQL1 = clone $SQL;
             $SQL2 = clone $SQL;
+            $SQL3 = clone $SQL;
             $model = new AccountWithDrawInfo();
 
 
@@ -188,6 +189,10 @@ class WithdrawalLogic extends BaseLogicController
                 $overUserCount->WithDraw = number_float($overUserCount->WithDraw / NumConfig::NUM_VALUE);
             }
 
+            // 手续费汇总(当前筛选条件下)
+            $totalWithdrawFeeRow = $SQL3->where($where)->selectRaw('sum(cast(ISNULL(ow.withdraw_fee,0) as bigint)) as total_withdraw_fee')->lock('with(nolock)')->first();
+            $totalWithdrawFee = isset($totalWithdrawFeeRow->total_withdraw_fee) ? number_float($totalWithdrawFeeRow->total_withdraw_fee / NumConfig::NUM_VALUE) : 0;
+
             $userIDs = [];
             $adminIDs = [];
             $agentIDs = [];
@@ -196,6 +201,7 @@ class WithdrawalLogic extends BaseLogicController
                 $val->actual_arrival = number_float(($val->WithDraw + $val->ServiceFee) / 100); // 实际提现金额
                 $val->ServiceFee = number_float($val->ServiceFee / 100);
                 $val->WithDraw = number_float($val->WithDraw / 100);
+                $val->withdraw_fee_display = number_float(($val->withdraw_fee ?? 0) / NumConfig::NUM_VALUE);
                 $val->sameNameNum=$accountsInfo->sameWithDrawBankName($val->BankUserName);
                 $val->sameEmailNum=$accountsInfo->sameWithDrawEmail($val->EmailAddress);
                 $val->sameMac=$accountsInfo->sameLoginMacCount($val->UserID);
@@ -280,7 +286,7 @@ class WithdrawalLogic extends BaseLogicController
             ->select('PackageName', 'Channel')
             ->pluck('PackageName', 'Channel');
 
-        return compact('applyUserCount', 'overUserCount', 'list', 'payState', 'allChannel', 'Channel', 'GameID', 'withdraw_search', 'withdraw', 'state', 'start_time', 'end_time', 'agent', 'orderID', 'final_start_time', 'final_end_time', 'take_effect', 'withdrawal_administrator', 'isEmpty', 'register_start_time', 'register_end_time', 'PackgeName', 'ChannelPackageName');
+        return compact('applyUserCount', 'overUserCount', 'list', 'totalWithdrawFee', 'payState', 'allChannel', 'Channel', 'GameID', 'withdraw_search', 'withdraw', 'state', 'start_time', 'end_time', 'agent', 'orderID', 'final_start_time', 'final_end_time', 'take_effect', 'withdrawal_administrator', 'isEmpty', 'register_start_time', 'register_end_time', 'PackgeName', 'ChannelPackageName');
     }
 
 

+ 6 - 2
resources/views/admin/Withdrawal/verify_finish.blade.php

@@ -227,6 +227,7 @@
                                     <th>{{ __('auto.提交时间') }}</th>
                                     <th>{{ __('auto.茶叶申请额度') }}</th>
                                     <th>{{ __('auto.实际到账金额') }}</th>
+                                    <th>{{ __('auto.手续费') }}</th>
                                     <th>{{ __('auto.审核状态') }}</th>
                                     <th>{{ __('auto.茶叶完成情况') }}</th>
                                     <th>{{ __('auto.审核人') }}</th>
@@ -248,8 +249,10 @@
                                         {{ __('auto.实际到账:') }}
                                         {{$overUserCount->userCount ?? 0}} {{ __('auto.人') }}&nbsp;&nbsp;
                                         {{$overUserCount->count ?? 0}} {{ __('auto.笔') }}&nbsp;&nbsp;
-                                        {{$overUserCount->WithDraw ?? 0}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-
+                                        {{$overUserCount->WithDraw ?? 0}}
+                                        @if(!empty($viewAll))
+                                            &nbsp;&nbsp;{{ __('auto.手续费汇总:') }}{{ $totalWithdrawFee ?? 0 }}
+                                        @endif
                                     </h4>
                                 @endif
 
@@ -279,6 +282,7 @@
                                         <td>{{date('Y-m-d H:i:s',strtotime($item->CreateDate))}}</td>
                                         <td>{{$item->actual_arrival}}</td>
                                         <td>{{$item->WithDraw}}</td>
+                                        <td>{{ $item->withdraw_fee_display ?? 0 }}</td>
                                         <td>
                                             {!! $item->States !!}
                                             @if($item->State == 5)

+ 5 - 0
resources/views/admin/recharge/list.blade.php

@@ -175,6 +175,7 @@
                                             </svg>
                                         </div>
                                     </th>
+                                    <th width="6%">{{ __('auto.手续费') }}</th>
                                     <th width="8%">{{ __('auto.变化后余额') }}</th>
                                     <th width="8%">{{ __('auto.当前余额') }}</th>
 
@@ -203,6 +204,9 @@
                                         @endif
                                         <h4>{{ __('auto.总金额:') }}{{$totalMoney}} &nbsp;&nbsp; {{$payTotalMoney->count_u ?? 0}}{{ __('auto.人') }}&nbsp;&nbsp;{{$payTotalMoney->count_id ?? 0}}{{ __('auto.笔') }}</h4>
                                         <h4>{{ __('auto.已到账:') }}{{$overMoney}} &nbsp;&nbsp;{{$payOverMoney->count_u ?? 0}}{{ __('auto.人') }}&nbsp;&nbsp;{{$payOverMoney->count_id ?? 0}}{{ __('auto.笔') }}</h4>
+                                        @if(!empty($viewAll))
+                                            <h4>{{ __('auto.手续费汇总:') }}{{ $totalPaymentFee ?? 0 }}</h4>
+                                        @endif
                                     </div>
                                 @endif
 
@@ -213,6 +217,7 @@
                                         <td>{{$v->finished_at}}</td>
                                         <td>{{$v->finished_at ? dateConvert($v->finished_at) : ''}}</td>
                                         <td>{{ $v->amount }}</td>
+                                        <td>{{ $v->payment_fee ?? 0 }}</td>
                                         <td>{{ $v->after_amount }}</td>
                                         <td>{{ $v->score }}</td>