StephenArk30 5 年之前
父節點
當前提交
da5b891c12
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/api/controller/goods.js

+ 2 - 2
src/api/controller/goods.js

@@ -285,9 +285,9 @@ l
     if (think.isEmpty(relatedGoodsIds)) {
       // 查找同分类下的商品
       const goodsCategory = await model.where({id: goodsId}).find();
-      relatedGoods = await model.where({category_id: goodsCategory.category_id}).field(['id', 'name', 'list_pic_url', 'retail_price']).limit(8).select();
+      relatedGoods = await model.where({category_id: goodsCategory.category_id, is_new: 0}).field(['id', 'name', 'list_pic_url', 'retail_price']).limit(8).select();
     } else {
-      relatedGoods = await model.where({id: ['IN', relatedGoodsIds]}).field(['id', 'name', 'list_pic_url', 'retail_price']).select();
+      relatedGoods = await model.where({id: ['IN', relatedGoodsIds], is_new: 0}).field(['id', 'name', 'list_pic_url', 'retail_price']).select();
     }
 
     return this.success({