Browse Source

微信支付实得金额

sunhao 5 years ago
parent
commit
454e5aea28

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

5090
         foreach($result as $k=>&$v){
5090
         foreach($result as $k=>&$v){
5091
             #团队销售
5091
             #团队销售
5092
             $saler_ids = $saler_ids_arr[$v['team_id']];
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
             $v['pay_amount'] = $today_deposit->pay_amount;
5094
             $v['pay_amount'] = $today_deposit->pay_amount;
5095
             $v['discount'] = $today_deposit->discount;
5095
             $v['discount'] = $today_deposit->discount;
5096
             $v['deposit_amount'] = $today_deposit->deposit_amount;
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
             $v['team_name'] = $team_name_arr[$v['team_id']];
5102
             $v['team_name'] = $team_name_arr[$v['team_id']];
5100
             //累计充值金额            
5103
             //累计充值金额            
5153
         foreach($result as $k=>&$v){
5156
         foreach($result as $k=>&$v){
5154
             #团队销售
5157
             #团队销售
5155
             $saler_ids = $saler_ids_arr[$v['team_id']];
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
             $v['pay_amount'] = $today_deposit->pay_amount;
5160
             $v['pay_amount'] = $today_deposit->pay_amount;
5158
             $v['discount'] = $today_deposit->discount;
5161
             $v['discount'] = $today_deposit->discount;
5159
             $v['deposit_amount'] = $today_deposit->deposit_amount;
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
             $v['team_name'] = $team_name_arr[$v['team_id']];
5168
             $v['team_name'] = $team_name_arr[$v['team_id']];
5163
             //累计充值金额            
5169
             //累计充值金额            
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
         $filename = 'chongzhihuizong_'.date('Y-m-d_H').'.xlsx';
5183
         $filename = 'chongzhihuizong_'.date('Y-m-d_H').'.xlsx';
5178
         return Order::export_excel($result, $filename, $indexKey, $title); 
5184
         return Order::export_excel($result, $filename, $indexKey, $title); 
5179
     }
5185
     }

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

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