by Robin at 20240628

This commit is contained in:
Leufolium 2024-06-28 15:35:12 +08:00
parent 361c7b33b8
commit 4960594228
1 changed files with 4 additions and 7 deletions

View File

@ -1029,21 +1029,18 @@ func (m *Mysql) GetWithdrawOrdersByMid(ctx *gin.Context, tx *sqlx.Tx, mid, st, e
// 从订单号获取提现订单
func (m *Mysql) GetWithdrawOrderById(ctx *gin.Context, tx *sqlx.Tx, id string) (wOrder *dbstruct.WithdrawOrder, err error) {
wOrder = &dbstruct.WithdrawOrder{}
var tmpOrder dbstruct.WithdrawOrder
sqlStr := fmt.Sprintf("select * from %s where id=?", TableWithdrawOrder)
if tx != nil {
err = tx.SelectContext(ctx, wOrder, sqlStr, id)
err = tx.GetContext(ctx, &tmpOrder, sqlStr, id)
} else {
db := m.getDBVas()
err = db.SelectContext(ctx, wOrder, sqlStr, id)
}
if err == sql.ErrNoRows {
err = nil
return
err = db.GetContext(ctx, &tmpOrder, sqlStr, id)
}
if err != nil {
return
}
wOrder = &tmpOrder
return
}