This commit is contained in:
suyl
2021-04-28 11:12:32 +08:00
parent 9a725ed9c2
commit 0ad4efa6a6
2 changed files with 16 additions and 10 deletions

View File

@@ -196,8 +196,8 @@ func UnionOrderCallBack(unionOrder *partner.UnionOrderInfo) (err error) {
if unionOrder.SID == "" {
return err
}
userID := unionOrder.SID[:32]
jobID := unionOrder.SID[32:]
mobile := unionOrder.SID[:11]
jobID := unionOrder.SID[11:]
txDB, _ := dao.Begin(db)
defer func() {
if r := recover(); r != nil {
@@ -205,7 +205,12 @@ func UnionOrderCallBack(unionOrder *partner.UnionOrderInfo) (err error) {
panic(r)
}
}()
userBill, err := dao.GetUserBill(db, userID, "")
user, err := dao.GetUserByID(db, "mobile", mobile)
if err != nil {
dao.Rollback(db, txDB)
return err
}
userBill, err := dao.GetUserBill(db, user.UserID, "")
if userBill == nil {
return fmt.Errorf("未查询到该用户的账单!")
}