Browse Source

优惠券-统计使用数量条件修改

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

4
app/Console/Commands/couponReport.php

@ -72,13 +72,13 @@ class couponReport extends Command
,discounts as 优惠金额 ,discounts as 优惠金额
,inventory AS 发放数量 ,inventory AS 发放数量
,inventory_use 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 FROM
ims_system_coupon_user coupon ims_system_coupon_user coupon
LEFT JOIN ims_system_coupon_user_receive receive ON coupon.id = receive.system_coupon_user_id 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", GROUP BY coupon.id",
$where
array_merge($where,$where)
); );
// 查询优惠券订单用户数据 // 查询优惠券订单用户数据
// $orderList = DB::select("SELECT // $orderList = DB::select("SELECT

Loading…
Cancel
Save