wangfei 6 年 前
コミット
0ea7f3b5a3
共有2 個のファイルを変更した10 個の追加0 個の削除を含む
  1. 5
    0
      service/course/order.go
  2. 5
    0
      service/goods/orders.go

+ 5
- 0
service/course/order.go ファイルの表示

@@ -85,6 +85,11 @@ func (s *CourseServ) Orders(
85 85
 		if customerCoupon == nil || customerCoupon.CustomerCouponId == "" {
86 86
 			return errors.New("优惠券无效!")
87 87
 		}
88
+
89
+		if customerCoupon.CaseId != couseOrder.CaseId {
90
+			return errors.New("优惠券对应案场与下单案场不一致,不允许下单!")
91
+		}
92
+
88 93
 		if customerCoupon.Status != models.STATUS_NORMAL || !customerCoupon.UseDate.IsZero() {
89 94
 			return errors.New("优惠券已被使用!请重新选择优惠券!")
90 95
 		}

+ 5
- 0
service/goods/orders.go ファイルの表示

@@ -67,6 +67,11 @@ func (s *GoodsServ) Orders(
67 67
 			if customerCoupon == nil || customerCoupon.CustomerCouponId == "" {
68 68
 				return errors.New("优惠券无效!")
69 69
 			}
70
+
71
+			if customerCoupon.CaseId != info.CaseId {
72
+				return errors.New("优惠券对应案场与下单案场不一致,不允许下单!")
73
+			}
74
+
70 75
 			if customerCoupon.Status != models.STATUS_NORMAL || !customerCoupon.UseDate.IsZero() {
71 76
 				return errors.New("优惠券已被使用!请重新选择优惠券!")
72 77
 			}