diff --git a/app/Console/Commands/couponReport.php b/app/Console/Commands/couponReport.php index 3159203..e8c5306 100644 --- a/app/Console/Commands/couponReport.php +++ b/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