zoujiajian пре 7 месеци
родитељ
комит
51007514a7

+ 9 - 4
netflix-web/src/main/java/com/cyksj/web/controller/goods/GoodsDonController.java

@@ -441,8 +441,8 @@ public class GoodsDonController {
 
 							views.setSpecs(beanSearcher.searchFirst(GoodsDonSpecFrontView.class, MapUtils.builder().field(GoodsDonSpecFrontView::getGoodsId, views.getId()).build()));
 							//把开启订阅提醒的规格展示出来
-							String condition = "1 = 1 or (sku.status = 0 and sku.is_subscribe_alert)";
-							MapBuilder builder = MapUtils.builder().field(GoodsDonSkuFrontView::getGoodsId, views.getId()).put("condition", condition).field(GoodsDonSkuFrontView::getStatus, true);
+							String condition = "(sku.status or (sku.status = 0 and sku.is_subscribe_alert))";
+							MapBuilder builder = MapUtils.builder().field(GoodsDonSkuFrontView::getGoodsId, views.getId()).put("condition", condition);
 
 							if (views.getType() == 1) {
 								builder.orderBy(GoodsDonSkuFrontView::getSorted).asc();
@@ -746,7 +746,12 @@ public class GoodsDonController {
 					try {
 						o = redisService.get(key);
 						if (o == null) {
-							String condition = "g.deleted is true and g.status is true or (g.status = 0 and g.is_subscribe_alert)";
+							String condition = "g.deleted";
+							if (yhsId == null) {
+								condition += " and (g.status or (g.status = 0 and g.is_subscribe_alert))";
+							} else {
+								condition += " and g.status";
+							}
 							Long finalYhsId = yhsId;
 							if (yhsId != null) {
 								condition += String.format(" and g.id in (select distinct goods_id from yh_shop_goods_sku where yhs_id = %s and status is true and deleted is true) and g.is_distribute is true", yhsId);
@@ -1269,7 +1274,7 @@ public class GoodsDonController {
 							DateTime now = DateTime.now();
 							MapBuilder mapBuilder = MapUtils.flatBuilder(request.getParameterMap());
 							//把开启订阅提醒的商品展示出来
-							String condition = "or (g.status = 0 and g.is_subscribe_alert)";
+							String condition = "(g.status or (g.status = 0 and g.is_subscribe_alert))";
 							if (cgy != null) {
 								condition += String.format(" and gcr.category = %s", cgy);
 							}