Merge pull request 'by Robin at 20240628' (#569) from feat-IRONFANS-148-Robin into main

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/569
This commit is contained in:
chenhao 2024-06-28 15:35:57 +08:00
commit 817ceb47a2
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
}