废弃,不进行检测是否已发放
This commit is contained in:
parent
575c93bb73
commit
7dbab928bb
@ -73,6 +73,10 @@ func (r *CouponService) AddSystemCoupon(req requests.AddSystemCoupon) (bool, err
|
|||||||
if *req.WithAmount == 0 {
|
if *req.WithAmount == 0 {
|
||||||
return false, errors.New("请填入符合满减标准金额")
|
return false, errors.New("请填入符合满减标准金额")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if *req.WithAmount > *req.CouponPrice {
|
||||||
|
return false, errors.New("满减标准金额不可超过优惠卷金额")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 数量
|
// 数量
|
||||||
@ -571,14 +575,15 @@ func (r *CouponService) GrantSystemCoupon(couponId, adminUserId int64, req reque
|
|||||||
// 检测用户是否已领取该优惠卷
|
// 检测用户是否已领取该优惠卷
|
||||||
userCouponDao := dao.UserCouponDao{}
|
userCouponDao := dao.UserCouponDao{}
|
||||||
|
|
||||||
maps = make(map[string]interface{})
|
//// 废弃,不进行检测是否已发放
|
||||||
maps["user_id"] = user.UserId
|
//maps = make(map[string]interface{})
|
||||||
maps["coupon_id"] = coupon.CouponId
|
//maps["user_id"] = user.UserId
|
||||||
maps["user_coupon_status"] = 0
|
//maps["coupon_id"] = coupon.CouponId
|
||||||
userCoupons, _ := userCouponDao.GetUserCouponList(maps)
|
//maps["user_coupon_status"] = 0
|
||||||
if len(userCoupons) >= req.SingleQuantity {
|
//userCoupons, _ := userCouponDao.GetUserCouponList(maps)
|
||||||
return false, errors.New("用户已有该优惠卷")
|
//if len(userCoupons) >= req.SingleQuantity {
|
||||||
}
|
// return false, errors.New("用户已有该优惠卷")
|
||||||
|
//}
|
||||||
|
|
||||||
// 开始事务
|
// 开始事务
|
||||||
tx := global.Db.Begin()
|
tx := global.Db.Begin()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user