yansen 6 年 前
コミット
2f502f1c32
共有2 個のファイルを変更した2 個の追加2 個の削除を含む
  1. 1
    1
      models/goods/orders.go
  2. 1
    1
      models/model/ta_goods_orders.go

+ 1
- 1
models/goods/orders.go ファイルの表示

@@ -51,7 +51,7 @@ func (m *GoodsDAO) SaveOrders(order *model.TaGoodsOrders) error {
51 51
 	order.IsPay = models.BOOL_TRUE // 默认已支付
52 52
 	order.CouponAmount = "0"
53 53
 	order.IsIntimidate = INTIMIDATE_NO
54
-	order.DupKey = utils.GetFiveSeconds(now)
54
+	order.DupKey = utils.GetFiveSeconds(now) + order.UserId + order.TableId + strconv.Itoa(order.Status)
55 55
 
56 56
 	// 当前订单号的随机方式 = 时间 + 个人ID
57 57
 	ordersno := "G-" + now.Format("20060102150405") + "-" + strings.Join(utils.GUIID2IntString(order.UserId), "")

+ 1
- 1
models/model/ta_goods_orders.go ファイルの表示

@@ -28,5 +28,5 @@ type TaGoodsOrders struct {
28 28
 	ActualAmount string `xorm:"DECIMAL(8,2)"`
29 29
 	CouponAmount string `xorm:"DECIMAL(8,2)"`
30 30
 	IsIntimidate int    `xorm:"SMALLINT(6)"`
31
-	DupKey       string `xorm:"VARCHAR(32)"`
31
+	DupKey       string `xorm:"VARCHAR(255)"`
32 32
 }