lrf 2 years ago
parent
commit
4365617d5a
2 changed files with 2 additions and 2 deletions
  1. 1 1
      app/controller/shop/config/.goods.js
  2. 1 1
      app/service/view/goods.js

+ 1 - 1
app/controller/shop/config/.goods.js

@@ -35,7 +35,7 @@ module.exports = {
     options: {
       query: ['skip', 'limit'],
       sort: ['sort'],
-      asc: true,
+      desc: false,
       count: true,
     },
   },

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

@@ -22,7 +22,7 @@ class GoodsService extends CrudService {
     let goods = await this.goodsModel.findById(id, { file: 1, tags: 1, name: 1, shot_brief: 1, brief: 1, send_time: 1, shop: 1, view_num: 1 }).populate(populate);
     if (!goods) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到商品数据');
     goods = JSON.parse(JSON.stringify(goods));
-    let specs = await this.goodsSpecModel.find({ goods: id, status: '0' }, { sell_money: 1, flow_money: 1, freight: 1, name: 1, num: 1, can_group: 1, group_config: 1 });
+    let specs = await this.goodsSpecModel.find({ goods: id, status: '0' }, { sell_money: 1, flow_money: 1, freight: 1, name: 1, num: 1, can_group: 1, group_config: 1, file: 1 });
     specs = JSON.parse(JSON.stringify(specs));
     goods = _.omit(goods, [ 'meta', '__v' ]);
     const shop = _.pick(goods.shop, [ 'logo', 'name', 'person', 'phone', '_id' ]);