From b676641e11008cb05b4e595850dbbf617fb7da56 Mon Sep 17 00:00:00 2001
From: 陶杰 <1378534974@qq.com>
Date: 星期四, 29 八月 2024 17:37:06 +0800
Subject: [PATCH] 1.积分优惠券-获取全部已发布的优惠券

---
 src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml b/src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml
index 62f1f26..11af393 100644
--- a/src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml
+++ b/src/main/resources/mapper/coupon/CouponTemplateMapperCustom.xml
@@ -70,11 +70,11 @@
             create_by_user.nick_name as createByName,
             IFNULL(get_num.cnt, 0) as getNum,
             IFNULL(t.coupon_amount, 0) - IFNULL(get_num.cnt, 0) as unGetNum
-            from t_coupon_template t
-            left join t_user create_by_user
-            on t.create_by =create_by_user.id
-            left join (select coupon_template_id,count(1) as cnt  from t_coupon_usage where deleted=0 group by coupon_template_id) get_num
-            on t.id=get_num.coupon_template_id
+        from t_coupon_template t
+        left join t_user create_by_user
+        on t.create_by =create_by_user.id
+        left join (select coupon_id,count(1) as cnt  from t_coupon_record where deleted=0 group by coupon_id) get_num
+        on t.id=get_num.coupon_id
         ) t
         where t.deleted=0
         <if test="param.name != null and param.name != ''">
@@ -95,6 +95,9 @@
         <if test="param.category != null and param.category != ''">
             AND t.category =  #{param.category}
         </if>
+        <if test="param.status != null and param.status != ''">
+            AND t.status =  #{param.status}
+        </if>
         order by t.create_time desc
     </sql>
 

--
Gitblit v1.9.3