|
@@ -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
|
}
|