lrf 2 năm trước cách đây
mục cha
commit
0f1ad39af8
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      app/service/view/goods.js

+ 2 - 2
app/service/view/goods.js

@@ -25,7 +25,7 @@ class GoodsService extends CrudService {
   async goodsDetail({ id }) {
     assert(id, '缺少商品信息');
     const pipeline = [{ $match: { _id: ObjectId(id) } }];
-    const goodsProject = { file: 1, tags: 1, name: 1, shot_brief: 1, brief: 1, send_time: 1, shop: 1, view_num: 1, act_tags: 1 };
+    const goodsProject = { file: 1, tags: 1, name: 1, shot_brief: 1, brief: 1, send_time: 1, shop: 1, view_num: 1, act_tags: 1, sell_num: 1 };
     // 将 活动标签都进行数据替换
     pipeline.push({
       $lookup: {
@@ -124,6 +124,7 @@ class GoodsService extends CrudService {
           act_tags: '$$CURRENT.act_tags',
           shot_brief: '$$CURRENT.shot_brief',
           view_num: '$$CURRENT.view_num',
+          sell_num: '$$CURRENT.sell_num',
         },
         shop: '$shopInfo',
         specs: '$specs',
@@ -159,7 +160,6 @@ class GoodsService extends CrudService {
     return data;
   }
 
-
   async indexGoodsList(condition, { skip = 0, limit = 20 } = {}) {
     condition = this.dealFilter(condition);
     const pipeline = [{ $match: { status: { $ne: '0' } } }]; // { $sort: { sort: 1 } },