From 28389578879c1a3db535750662c69e626a231be8 Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Mon, 17 Aug 2020 10:36:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8-=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=95=B0=E9=87=8F=E6=9D=A1=E4=BB=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/couponReport.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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