Browse Source

商品上下架的时候修改首页展示2

Yangzw 5 days ago
parent
commit
8b1178b7f3

+ 1 - 1
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spuapply/SpuApplyServiceImpl.java

@@ -366,7 +366,7 @@ public class SpuApplyServiceImpl implements SpuApplyService {
         // 修改首页面的商品展示,如果商品下架要看有没有展示,要去除
         if (updateReqVO.getStatus().equals(ProductSpuStatusEnum.DISABLE.getStatus())) {
             DiyPageDO diyPage = diyPageService.getDiyPage(7L);
-            if (diyPage.getProperty().contains(spu.getId().toString() + ",")) {
+            if (diyPage.getProperty().contains(spu.getId().toString() + ",") || diyPage.getProperty().contains(spu.getId() + "]")) {
                 diyPage.setProperty(diyPage.getProperty().replace(spu.getId() + ",", ""));
                 diyPageService.updateDiyPage(BeanUtils.toBean(diyPage, DiyPageUpdateReqVO.class));
             }