|
|
|
@ -72,11 +72,12 @@ class couponReport extends Command |
|
|
|
,discounts as 优惠金额 |
|
|
|
,inventory AS 发放数量 |
|
|
|
,inventory_use as 已领取数量 |
|
|
|
,IFNULL((SELECT SUM(IFNULL(number,0)) FROM ims_system_coupon_user_use WHERE system_coupon_id = coupon.id AND TO_DAYS(receive.created_at) = TO_DAYS(NOW())),0) AS 使用数量 |
|
|
|
,IFNULL((SELECT SUM(IFNULL(number,0)) FROM ims_system_coupon_user_use WHERE system_coupon_id = coupon.id AND TO_DAYS(use_time) = TO_DAYS(NOW())),0) AS 使用数量 |
|
|
|
FROM |
|
|
|
ims_system_coupon_user coupon |
|
|
|
LEFT JOIN ims_system_coupon_user_receive receive ON coupon.id = receive.system_coupon_user_id |
|
|
|
WHERE receive.created_at BETWEEN ? AND ?",
|
|
|
|
WHERE receive.created_at BETWEEN ? AND ? |
|
|
|
GROUP BY coupon.id",
|
|
|
|
$where |
|
|
|
); |
|
|
|
// 查询优惠券订单用户数据
|
|
|
|
@ -113,7 +114,7 @@ class couponReport extends Command |
|
|
|
// $listArray[] = (array)$value;
|
|
|
|
// }
|
|
|
|
if($return){ |
|
|
|
return json_encode(compact($orderTotal,$receiveCoupon,$orderList)); |
|
|
|
// return json_encode(compact($orderTotal,$receiveCoupon,$orderList));
|
|
|
|
}else{ |
|
|
|
$this->table(['优惠券标题','使用优惠券消费总额(实付总金额)','订单总额(不包含配送费,含包装费)','配送费','优惠总金额','总订单数量'],$orderArray); |
|
|
|
$this->table(['ID','优惠券标题','满足金额','优惠金额','发放数量','已领取数量','使用数量'],$receiveArray); |
|
|
|
|