Преглед на файлове

微信支付实得金额

sunhao преди 5 години
родител
ревизия
454e5aea28
променени са 2 файла, в които са добавени 14 реда и са изтрити 4 реда
  1. 10 4
      app/Http/Controllers/Admin/StatisticsController.php
  2. 4 0
      resources/views/statistics/depositDayReport.blade.php

+ 10 - 4
app/Http/Controllers/Admin/StatisticsController.php

@@ -5090,11 +5090,14 @@ class StatisticsController extends Controller
5090 5090
         foreach($result as $k=>&$v){
5091 5091
             #团队销售
5092 5092
             $saler_ids = $saler_ids_arr[$v['team_id']];
5093
-            $today_deposit = CustomerDeposit::select(DB::raw('sum(pay_amount) as pay_amount, sum(discount) as discount, sum(deposit_amount) as deposit_amount'))->where('is_del', 0)->whereRaw('left(pay_time,10)="'.$v['date'].'"')->whereIn('admin_id', $saler_ids)->first();
5093
+            $today_deposit = CustomerDeposit::select(DB::raw('sum(pay_amount) as pay_amount, sum(discount) as discount, sum(deposit_amount) as deposit_amount, sum(if(payment_type=3,deposit_amount,null)) as gth_amount'))->where('is_del', 0)->whereRaw('left(pay_time,10)="'.$v['date'].'"')->whereIn('admin_id', $saler_ids)->first();
5094 5094
             $v['pay_amount'] = $today_deposit->pay_amount;
5095 5095
             $v['discount'] = $today_deposit->discount;
5096 5096
             $v['deposit_amount'] = $today_deposit->deposit_amount;
5097 5097
 
5098
+            $v['gth_amount'] = $today_deposit->gth_amount;
5099
+            $v['wx_amount'] = $v['deposit_amount'] - $v['gth_amount'];
5100
+
5098 5101
             //团队名称
5099 5102
             $v['team_name'] = $team_name_arr[$v['team_id']];
5100 5103
             //累计充值金额            
@@ -5153,11 +5156,14 @@ class StatisticsController extends Controller
5153 5156
         foreach($result as $k=>&$v){
5154 5157
             #团队销售
5155 5158
             $saler_ids = $saler_ids_arr[$v['team_id']];
5156
-            $today_deposit = CustomerDeposit::select(DB::raw('sum(pay_amount) as pay_amount, sum(discount) as discount, sum(deposit_amount) as deposit_amount'))->where('is_del', 0)->whereRaw('left(pay_time,10)="'.$v['date'].'"')->whereIn('admin_id', $saler_ids)->first();
5159
+            $today_deposit = CustomerDeposit::select(DB::raw('sum(pay_amount) as pay_amount, sum(discount) as discount, sum(deposit_amount) as deposit_amount, sum(if(payment_type=3,deposit_amount,null)) as gth_amount'))->where('is_del', 0)->whereRaw('left(pay_time,10)="'.$v['date'].'"')->whereIn('admin_id', $saler_ids)->first();
5157 5160
             $v['pay_amount'] = $today_deposit->pay_amount;
5158 5161
             $v['discount'] = $today_deposit->discount;
5159 5162
             $v['deposit_amount'] = $today_deposit->deposit_amount;
5160 5163
 
5164
+            $v['gth_amount'] = $today_deposit->gth_amount;
5165
+            $v['wx_amount'] = $v['deposit_amount'] - $v['gth_amount'];
5166
+
5161 5167
             //团队名称
5162 5168
             $v['team_name'] = $team_name_arr[$v['team_id']];
5163 5169
             //累计充值金额            
@@ -5172,8 +5178,8 @@ class StatisticsController extends Controller
5172 5178
 
5173 5179
         }
5174 5180
 
5175
-        $indexKey = ['team_name','date','pay_amount','discount','deposit_amount','pay_amount_total','discount_total','deposit_amount_total','order_amount','order_count'];
5176
-        $title = ['团队', '日期', '当日充值金额', '当日赠送金额', '当日实得金额', '累计充值金额', '累计赠送金额', '累计实得总金额', '当日消费金额', '当日订单数'];
5181
+        $indexKey = ['team_name','date','pay_amount','discount','deposit_amount','wx_amount','gth_amount','pay_amount_total','discount_total','deposit_amount_total','order_amount','order_count'];
5182
+        $title = ['团队', '日期', '当日充值金额', '当日赠送金额', '当日实得金额', '微信支付实得金额','个体户支付实得金额', '累计充值金额', '累计赠送金额', '累计实得总金额', '当日消费金额', '当日订单数'];
5177 5183
         $filename = 'chongzhihuizong_'.date('Y-m-d_H').'.xlsx';
5178 5184
         return Order::export_excel($result, $filename, $indexKey, $title); 
5179 5185
     }

+ 4 - 0
resources/views/statistics/depositDayReport.blade.php

@@ -31,6 +31,8 @@
31 31
                     <th width="4%">当日充值金额</th>
32 32
                     <th width="4%">当日赠送金额</th>
33 33
                     <th width="4%">当日实得金额</th>
34
+                    <th width="4%">微信支付实得金额</th>
35
+                    <th width="4%">个体户充值实得金额</th>
34 36
                     <th width="4%">累计充值金额</th>
35 37
                     <th width="4%">累计赠送金额</th>
36 38
                     <th width="4%">累计实得总金额</th>
@@ -48,6 +50,8 @@
48 50
                             <td>{{$a['pay_amount']}}</td>
49 51
                             <td>{{$a['discount']}}</td>
50 52
                             <td>{{$a['deposit_amount']}}</td>
53
+                            <td>{{$a['wx_amount']}}</td>
54
+                            <td>{{$a['gth_amount']}}</td>
51 55
                             <td>{{$a['pay_amount_total']}}</td>
52 56
                             <td>{{$a['discount_total']}}</td>
53 57
                             <td>{{$a['deposit_amount_total']}}</td>