Browse Source

Merge branch 'coupon_report' into develop

master
liangyuyan 5 years ago
parent
commit
fbb86cbcf5
  1. 4
      app/Console/Commands/couponReport.php

4
app/Console/Commands/couponReport.php

@ -72,13 +72,13 @@ 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(use_time) = TO_DAYS(NOW())),0) AS 使用数量
,IFNULL((SELECT SUM(IFNULL(number,0)) FROM ims_system_coupon_user_use WHERE system_coupon_id = coupon.id AND use_time BETWEEN ? AND ?),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 ?
GROUP BY coupon.id",
$where
array_merge($where,$where)
);
// 查询优惠券订单用户数据
// $orderList = DB::select("SELECT

Loading…
Cancel
Save