Prechádzať zdrojové kódy

为你推荐渠道为空的时候默认为3

zhangxin 2 týždňov pred
rodič
commit
46714ca173

+ 6 - 0
yami-shop-api/src/main/java/com/yami/shop/api/controller/ProdController.java

@@ -93,6 +93,9 @@ public class ProdController {
         }
         if (user != null) {
             String userId = user.getUserId();
+            if (channelId == null){
+                channelId = 3L;
+            }
             if (StringUtils.isNotEmpty(userId)) {
                 UserShopBehavior userShopBehavior = null;
                 userShopBehavior = userShopBehaviorService.findByUserIdAndProd(userId,shopId, prodId,channelId);
@@ -232,6 +235,9 @@ public class ProdController {
         if (user != null) {
             String userId = user.getUserId();
             if (StringUtils.isNotEmpty(userId)) {
+                if (channelId == null){
+                    channelId = 3L;
+                }
                 List<UserShopBehavior> byUserId = userShopBehaviorService.findByUserId(userId, 5,shopId,channelId);
                 for (UserShopBehavior userShopBehavior : byUserId) {
                     ChannelProd channelProd = userShopBehaviorService.findByProdId(userShopBehavior.getProdId(), userShopBehavior.getShopId(),channelId);