瀏覽代碼

修改卡券已使用状态

wangfei 6 年之前
父節點
當前提交
7505879080
共有 3 個文件被更改,包括 5 次插入2 次删除
  1. 1
    1
      models/card/card.go
  2. 3
    0
      models/constant.go
  3. 1
    1
      models/coupon/coupon.go

+ 1
- 1
models/card/card.go 查看文件

@@ -176,7 +176,7 @@ func (m *CardDAO) SaveCustomerCards(cards []model.TaCustomerCard) error {
176 176
 			cards[i].CustomerCardId = guid.NewGUIDString()
177 177
 		}
178 178
 
179
-		cards[i].Status = models.STATUS_NORMAL
179
+		cards[i].Status = models.STATUS_USED
180 180
 	}
181 181
 
182 182
 	if _, err := m.db.Insert(cards); err != nil {

+ 3
- 0
models/constant.go 查看文件

@@ -10,6 +10,9 @@ const (
10 10
 
11 11
 	// 正常
12 12
 	STATUS_NORMAL
13
+
14
+	// 已使用
15
+	STATUS_USED
13 16
 )
14 17
 
15 18
 // 过期

+ 1
- 1
models/coupon/coupon.go 查看文件

@@ -470,7 +470,7 @@ func (m *CouponDAO) VerifyCustomerCoupon(id string) error {
470 470
 	var customerCoupon = model.TaCustomerCoupon{
471 471
 		CustomerCouponId: id,
472 472
 		UseDate:          time.Now(),
473
-		Status:           models.STATUS_READY,
473
+		Status:           models.STATUS_USED,
474 474
 	}
475 475
 	var cols = []string{
476 476
 		"use_date",