lrf 2 years ago
parent
commit
6b92f44c2c
2 changed files with 4 additions and 3 deletions
  1. 3 3
      app/service/util/trade.js
  2. 1 0
      app/service/view/goods.js

+ 3 - 3
app/service/util/trade.js

@@ -175,19 +175,19 @@ class TradeService extends CrudService {
       const limit_num = _.get(goodsSpecData, 'limit_num', 0);
       if (buy_limit === '1') {
         if (num < limit_num) {
-          result.msg = `规格至少购买 ${limit_num} 份, 购买数量不足`;
+          result.msg = `规格至少购买 ${limit_num} 份, 购买数量不足`;
           result.result = false;
           return result;
         }
       } else if (buy_limit === '2') {
         if (num > limit_num) {
-          result.msg = `规格至多购买 ${limit_num} 份, 购买数量超过上限`;
+          result.msg = `规格至多购买 ${limit_num} 份, 购买数量超过上限`;
           result.result = false;
           return result;
         }
       } else if (buy_limit === '3') {
         if (num !== limit_num) {
-          result.msg = `规格只能购买 ${limit_num} 份`;
+          result.msg = `规格只能购买 ${limit_num} 份`;
           result.result = false;
           return result;
         }

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

@@ -248,6 +248,7 @@ class GoodsService extends CrudService {
     let list = await this.goodsModel.aggregate(qpipeline);
     list = list.map(i => {
       const obj = _.pick(i, [ 'name', 'file', 'num', 'flow_money', 'sell_money', 'view_num', '_id', 'actTagsShow', 'act_tags', 'leader_price' ]);
+      if (obj.leader_price) obj.leader_price = this.ctx.toNumber(obj.leader_price);
       return obj;
     });
     // 处理活动标签