op order list

This commit is contained in:
lwl0608 2024-03-21 16:05:11 +08:00
parent 6d73c70cf7
commit 66f90c6b45
1 changed files with 3 additions and 3 deletions

View File

@ -230,9 +230,9 @@ func (m *Mysql) GetOrdersByMid(ctx *gin.Context, tx *sqlx.Tx, mid int64, offset,
// 获取订单
func (m *Mysql) GetOrders(ctx *gin.Context, tx *sqlx.Tx, mid, st, et int64, offset, limit int) (list []*dbstruct.Order, err error) {
list = make([]*dbstruct.Order, 0)
sqlStr := fmt.Sprintf("select * from %s where ct>=%d and ct<%d limit %d offset %s", TableOrder, st, et, limit, offset)
sqlStr := fmt.Sprintf("select * from %s where ct>=%d and ct<%d limit %d offset %d", TableOrder, st, et, limit, offset)
if mid > 0 {
sqlStr = fmt.Sprintf("select * from %s where mid=%d", TableOrder, mid)
sqlStr = fmt.Sprintf("select * from %s where mid=%d limit %d offset %d", TableOrder, mid, limit, offset)
}
if tx != nil {
err = tx.SelectContext(ctx, &list, sqlStr)
@ -491,7 +491,7 @@ func (m *Mysql) GetCoinOrders(ctx *gin.Context, tx *sqlx.Tx, mid, st, et int64,
list = make([]*dbstruct.CoinOrder, 0)
sqlStr := fmt.Sprintf("select * from %s where ct>=%d and ct<%d limit %d offset %d", TableCoinOrder, st, et, limit, offset)
if mid > 0 {
sqlStr = fmt.Sprintf("select * from %s where mid=%d", TableCoinOrder, mid)
sqlStr = fmt.Sprintf("select * from %s where mid=%d limit %d offset %d", TableCoinOrder, mid, limit, offset)
}
if tx != nil {
err = tx.SelectContext(ctx, &list, sqlStr)