lrf 2 سال پیش
والد
کامیت
778ae2796c
3فایلهای تغییر یافته به همراه1 افزوده شده و 3 حذف شده
  1. 1 1
      app/service/trade/coupon.js
  2. 0 1
      app/service/user/userCoupon.js
  3. 0 1
      app/service/view/goods.js

+ 1 - 1
app/service/trade/coupon.js

@@ -25,7 +25,7 @@ class CouponService extends CrudService {
       else {
         const max = _.get(get_limit_config, 'max', 1);
         const num = await this.userCouponModel.count({ coupon: coupon._id, customer });
-        if (this.ctx.minus(num, max) > 0) coupon.canGet = false;
+        if (this.ctx.minus(num, max) >= 0) coupon.canGet = false;
       }
     }
     return list;

+ 0 - 1
app/service/user/userCoupon.js

@@ -39,7 +39,6 @@ class UserCouponService extends CrudService {
     const canGet = this.ctx.minus(coupon.num, 1) < 0;
     if (canGet) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '您手慢了,没抢到');
     const res = await this.checkCouponCanGet(coupon);
-    console.log(res);
     if (!res.result) return res;
     const customer = _.get(this.ctx, 'user._id');
     if (!customer) throw new BusinessError(ErrorCode.NOT_LOGIN, '未找到用户信息');

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

@@ -78,7 +78,6 @@ class GoodsService extends CrudService {
     // 分页处理
     if (parseInt(skip)) pipline.push({ $skip: parseInt(skip) });
     if (parseInt(limit)) pipline.push({ $limit: parseInt(limit) });
-    console.log(pipline);
     const list = await this.goodsModel.aggregate(pipline);
     return list;
   }