|
@@ -175,6 +175,18 @@ func (s *CourseServ) ConfirmOrders(ordersID, customercouponid string) error {
|
175
|
175
|
utils.LogError("优惠券核销出错: " + err.Error())
|
176
|
176
|
return errors.New("优惠券核销出错")
|
177
|
177
|
}
|
|
178
|
+ // 券库存处理
|
|
179
|
+ var couponinfo = model.TaCoupon{
|
|
180
|
+ CouponId: coupon.CouponId,
|
|
181
|
+ UsedCount: coupon.UsedCount + 1,
|
|
182
|
+ }
|
|
183
|
+ cols := []string{
|
|
184
|
+ "used_count",
|
|
185
|
+ }
|
|
186
|
+ if err := s.couponDAO.UpdateCoupon(&couponinfo, cols); err != nil {
|
|
187
|
+ utils.LogError("回填优惠券信息失败:", err)
|
|
188
|
+ return errors.New("回填优惠券信息失败!")
|
|
189
|
+ }
|
178
|
190
|
} else {
|
179
|
191
|
couseOrder.PayType = models.CONSUME_COINCHG
|
180
|
192
|
couseOrder.CouponAmount = "0.0"
|