Parcourir la source

推荐列表逻辑修改

zhangchen il y a 1 semaine
Parent
commit
12bb7b3810

+ 9 - 2
alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java

@@ -3102,8 +3102,15 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         calendar.set(Calendar.MILLISECOND, 0);
         // 加上 30 天
         calendar.add(Calendar.DAY_OF_MONTH, 30);
-        queryWrapper.gt("a.expiration_time", currentDate);
-        queryWrapper.eq("a.business_status", 0);
+        // 如果 expiration_time 为空则不做过期判断;如果不为空则要求大于当前时间
+        queryWrapper.and(w -> w.isNull("a.expiration_time")
+        .or()
+        .gt("a.expiration_time", currentDate));
+
+        // 如果 food_licence_expiration_time 为空则不做过期判断;如果不为空则要求大于当前时间
+        queryWrapper.and(w -> w.isNull("a.food_licence_expiration_time")
+                .or()
+                .gt("a.food_licence_expiration_time", currentDate));
 
         // 构建一级分类
         if(StringUtils.isNotEmpty(businessSection)){