zoujiajian před 3 roky
rodič
revize
1cb30a9b86

+ 1 - 2
netflix-dao/src/main/resources/mapper/CouponUserMapper.xml

@@ -35,7 +35,6 @@
         and cu.status != 'used'
         where cu.user_id = #{userId}
         and cu.channel != 'exCode'
-        and cu.valid_start_time > now()
         <if test="couponId == null">
             order by isAvailable desc
         </if>
@@ -59,7 +58,7 @@
         and cu.user_id = #{userId}
         and cu.status = 'unused'
         and cu.channel != 'exCode'
-        and cu.valid_start_time > now()
+        and cu.valid_start_time &lt; now()
         <if test="isRenew != null and isRenew">
             and cp.is_renew = #{isRenew}
         </if>

+ 4 - 0
netflix-web/src/main/java/com/cyksj/web/controller/coupon/CouponFrontController.java

@@ -70,6 +70,10 @@ public class CouponFrontController {
 	public Result<Page<CouponUserView>> couponPersonalList(@RequestParam(defaultValue = "1") Long start, @RequestParam(defaultValue = "5") Long limit) {
 		Long userId = StpUserUtil.getLoginIdAsLong();
 		Page<CouponUserView> page = couponUserMapper.couponPersonalList(userId, new Page<>(start, limit));
+		page.getRecords().forEach(data -> {
+			String str = couponSkuMapper.selectGoodsSkuStr(data.getCouponId());
+			data.setGoodsSkuStr(str.replaceAll(",", "/").replaceAll(";", ""));
+		});
 		return GatewayResponse.SUCCESS.newBuilder().toResult(page);
 	}