k.zhang 1 kuukausi sitten
vanhempi
commit
645adf2a67

+ 3 - 2
apis/shanghu/client.active.draw.log.go

@@ -73,8 +73,9 @@ func DrawLogVerificationCode(c *gin.Context) {
 		return
 	}
 
-	sqlData.DrawProductID = inData.DrawLogId
-	drawLog, err := sqlData.GetClientActiveDrawLogListById()
+	sqlData.ID = inData.DrawLogId
+	sqlData.ClientOpenID = inData.OpenId
+	drawLog, err := sqlData.GetClientActiveDrawLogListByOpenIdAndId()
 	if err != nil {
 		app.Error(c, 500, err, err.Error())
 		return

+ 2 - 2
apis/shanghu/models/active.pay.go

@@ -11,8 +11,8 @@ type PendingCancelAmountReply struct {
 
 type GetGroupBuyPayRequest struct {
 	OpenId       string `json:"open_id"`
-	UserType     int    `json:"user_type"` //1-商家 2-c端客户
-	GroupBuyType int    `json:"pay_type"`  //1-待核销 2-已核销
+	UserType     int    `json:"user_type"`      //1-商家 2-c端客户
+	GroupBuyType int    `json:"group_buy_type"` //1-待核销 2-已核销
 	PageSize     int    `json:"page_size"`
 	PageIndex    int    `json:"page_index"`
 }

+ 2 - 1
apis/shanghu/models/client.active.draw.log.go

@@ -13,7 +13,8 @@ type ClientDrawLogReply struct {
 }
 
 type DrawLogVerificationCodeRequest struct {
-	DrawLogId int64 `json:"draw_log_id"`
+	DrawLogId int64  `json:"draw_log_id"`
+	OpenId    string `json:"open_id"`
 }
 
 type DrawLogVerificationCodeReply struct {

+ 13 - 0
models/shanghu/client.active.draw.log.go

@@ -88,6 +88,19 @@ func (m *ClientActiveDrawLog) GetClientActiveDrawLogListById() (ClientActiveDraw
 	return doc, nil
 }
 
+func (m *ClientActiveDrawLog) GetClientActiveDrawLogListByOpenIdAndId() (ClientActiveDrawLog, error) {
+	var doc ClientActiveDrawLog
+
+	table := orm.ShMysql.Table(m.TableName())
+
+	table = table.Where("id = ? and client_open_id = ?", m.ID, m.ClientOpenID)
+	if err := table.Select("*").Order("id desc").First(&doc).Error; err != nil {
+		return doc, err
+	}
+
+	return doc, nil
+}
+
 func (m *ClientActiveDrawLog) UpdateDrawPrize() error {
 
 	if err := orm.ShMysql.Table(m.TableName()).Model(&m).Where("id = ? ", m.ID).Updates(