提交代码

dev-discount
胡锐 2 years ago
parent 19c887b939
commit 3998771ca3
  1. 6
      hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java
  2. 2
      hai-service/src/main/java/com/hai/dao/HighCouponMapperExt.java

@ -121,9 +121,11 @@ public class HighCouponController {
try {
HighCoupon coupon = highCouponService.getCouponById(couponId);
if (coupon != null & userId != null) {
if (coupon != null) {
coupon.setMonthlySales(highCouponService.getMonthlySales(couponId));
coupon.setNumberUpperLimitStatus(highCouponService.userBuyLimitNumber(userId, coupon.getId()));
if (userId != null) {
coupon.setNumberUpperLimitStatus(highCouponService.userBuyLimitNumber(userId, coupon.getId()));
}
}
return ResponseMsgUtil.success(coupon);

@ -13,6 +13,6 @@ public interface HighCouponMapperExt {
* @return
*/
@Select({"SELECT count(1) FROM `high_child_order` " +
"where goods_type = 1 and goods_id = #{couponId} and child_order_status in (2,3,6,7) and DATE_FORMAT(pay_time,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m');"})
" where goods_type = 1 and goods_id = #{couponId} and child_order_status in (2,3,6,7) and DATE_FORMAT(pay_time,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m')"})
int getMonthlySales(@Param("couponId") Long couponId);
}

Loading…
Cancel
Save