Selaa lähdekoodia

fix 店铺分类下平台月份天数

zoujiajian 1 vuosi sitten
vanhempi
sitoutus
c22598a81d

+ 15 - 0
netflix-web/src/main/java/com/cyksj/web/controller/goods/GoodsDonController.java

@@ -1105,6 +1105,21 @@ public class GoodsDonController {
 			value = redisService.get(categoryGoodsKey);
 		}
 		List<YhShopGoodsFrontCategoryView> list = Jsons.parseList(value, YhShopGoodsFrontCategoryView.class);
+		list.forEach(data->{
+			Optional.ofNullable(yhShopGoodsSkuMapper.selectOne(Wrappers.lambdaQuery(YhShopGoodsSku.class)
+					.eq(YhShopGoodsSku::getYhsId, yhsId)
+					.eq(YhShopGoodsSku::getGoodsId, data.getId())
+					.eq(YhShopGoodsSku::getPrice, data.getPrice())
+					.eq(YhShopGoodsSku::getStatus, 1)
+					.eq(YhShopGoodsSku::getDeleted, 1)
+					.last("limit 1"))).ifPresent(yhSku -> {
+				GoodsDonSku sku = goodsDonSkuMapper.selectById(yhSku.getSkuId());
+				if (sku != null) {
+					data.setMonths(sku.getMonths());
+					data.setDays(sku.getDays());
+				}
+			});
+		});
 		return GatewayResponse.SUCCESS.newBuilder().toResult(list);
 	}