k.zhang 1 hete
szülő
commit
9fc3ab5ed8
2 módosított fájl, 5 hozzáadás és 1 törlés
  1. 3 0
      apis/shanghu/active.pay.go
  2. 2 1
      models/shanghu/active.cancel.log.go

+ 3 - 0
apis/shanghu/active.pay.go

@@ -278,6 +278,7 @@ func GroupBuyCancelInfo(c *gin.Context) {
 		activeCancelSql.ClientOpenID = payTransInfo.ClientOpenID
 		activeCancelSql.ActiveConfigID = payTransInfo.ActiveConfigID
 		activeCancelSql.GroupByProjectID = v.ID
+		activeCancelSql.TransID = payTransInfo.ID
 		num := activeCancelSql.GetActiveCancelNumByProjectID()
 		fmt.Println("num = ", num)
 
@@ -352,6 +353,7 @@ func GroupBuyCancel(c *gin.Context) {
 		activeCancel.ClientOpenID = transInfo.ClientOpenID
 		activeCancel.ActiveConfigID = transInfo.ActiveConfigID
 		activeCancel.GroupByProjectID = v.ID
+		activeCancel.TransID = transInfo.ID
 
 		cancelNum := activeCancel.GetActiveCancelNumByProjectID()
 		fmt.Println("cancelNum = ", cancelNum)
@@ -370,6 +372,7 @@ func GroupBuyCancel(c *gin.Context) {
 				activeCancelLogInfo.ClientOpenID = transInfo.ClientOpenID
 				activeCancelLogInfo.MerchantOpenID = inData.OpenId
 				activeCancelLogInfo.GroupByProjectID = v.ID
+				activeCancelLogInfo.TransID = transInfo.ID
 				activeCancelLogInfo.CreatedAt = time.Now()
 				activeCancelLogInfo.UpdatedAt = time.Now()
 

+ 2 - 1
models/shanghu/active.cancel.log.go

@@ -12,6 +12,7 @@ type ActiveCancelLog struct {
 	ActiveConfigID   int64     `gorm:"column:active_config_id;type:bigint(20)" json:"active_config_id"`       // 活动id
 	GroupByProjectID int64     `gorm:"column:group_by_project_id;type:bigint(20)" json:"group_by_project_id"` // 拼团商品id
 	SeckillID        int64     `gorm:"column:seckill_id;type:bigint(20)" json:"seckill_id"`                   // 秒杀id
+	TransID          int64     `gorm:"column:trans_id;type:bigint(20)" json:"trans_id"`                       // 交易id
 	UpdateBy         int64     `gorm:"column:update_by;type:bigint(20)" json:"update_by"`
 	CreateBy         int64     `gorm:"column:create_by;type:bigint(20)" json:"create_by"`
 	CreatedAt        time.Time `gorm:"column:created_at;type:datetime" json:"created_at"`
@@ -36,7 +37,7 @@ func (m *ActiveCancelLog) GetActiveCancelNum() int {
 func (m *ActiveCancelLog) GetActiveCancelNumByProjectID() int {
 	var count int
 
-	tableCount := orm.ShMysql.Table(m.TableName()).Where("active_config_id = ? and client_open_id = ? and group_by_project_id = ?", m.ActiveConfigID, m.ClientOpenID, m.GroupByProjectID)
+	tableCount := orm.ShMysql.Table(m.TableName()).Where("active_config_id = ? and client_open_id = ? and group_by_project_id = ? and trans_id = ?", m.ActiveConfigID, m.ClientOpenID, m.GroupByProjectID, m.TransID)
 	tableCount.Count(&count)
 	return count
 }