fix: 拦截重复回调
This commit is contained in:
parent
a556777369
commit
57a3154634
@ -112,6 +112,22 @@ func UpdateOrderRecordByOrderNO(orderRecord *model.BundleOrderRecords) (res *bun
|
|||||||
valueAdd.CheckoutSessionId = orderRecord.CheckoutSessionId
|
valueAdd.CheckoutSessionId = orderRecord.CheckoutSessionId
|
||||||
valueAdd.CheckoutSessionUrl = orderRecord.CheckoutSessionUrl
|
valueAdd.CheckoutSessionUrl = orderRecord.CheckoutSessionUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if orderRecord.Status == 2 {
|
||||||
|
tempValues := make([]*model.BundleOrderValueAdd, 0)
|
||||||
|
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
|
||||||
|
Where("order_no = ?", orderRecord.OrderNo).
|
||||||
|
Find(&tempValues).Error
|
||||||
|
if len(tempValues) > 0 {
|
||||||
|
for _, value := range tempValues {
|
||||||
|
if value.PaymentStatus == 2 {
|
||||||
|
fmt.Println("====================已经付过了")
|
||||||
|
return nil, errors.New("已付款了")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
|
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
|
||||||
Where("order_no = ?", orderRecord.OrderNo).
|
Where("order_no = ?", orderRecord.OrderNo).
|
||||||
Updates(valueAdd).Error
|
Updates(valueAdd).Error
|
||||||
|
Loading…
Reference in New Issue
Block a user