zhijiezhao пре 1 година
родитељ
комит
57625d0b36

+ 3 - 0
src/main/java/com/caimei365/commodity/service/impl/CouponServiceImpl.java

@@ -293,6 +293,9 @@ public class CouponServiceImpl implements CouponService {
 
     @Override
     public ResponseJson<CouponVo> findCouponDetail(Integer couponId) {
+        /** todo
+         *  暂未引入userid获取注册时间作为领取时间判断条件,有需要再改
+         */
         CouponVo couponVo = couponMapper.findCouponDetail(couponId);
         return ResponseJson.success(couponVo);
     }

+ 7 - 1
src/main/resources/mapper/CouponMapper.xml

@@ -329,7 +329,13 @@
                cc.couponPayWay
         FROM cm_coupon cc
                  LEFT JOIN shop s ON cc.shopId = s.shopId
-        where id = #{couponId}
+        where cc.delFlag = 0
+          AND cc.vipFlag != 1
+          AND cc.status != 2
+          AND cc.couponType IN (0,1,3)
+          and NOW() <![CDATA[ > ]]> cc.startDate
+          and NOW() <![CDATA[ < ]]> cc.endDate
+          AND cc.id = #{couponId}
     </select>
     <select id="findUserPermission" resultType="java.lang.Integer">
         select userIdentity