Browse Source

bug修改

wangfei 6 years ago
parent
commit
0ea7f3b5a3
2 changed files with 10 additions and 0 deletions
  1. 5
    0
      service/course/order.go
  2. 5
    0
      service/goods/orders.go

+ 5
- 0
service/course/order.go View File

@@ -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 View File

@@ -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
 			}