Merge pull request 'by Robin at 20240516' (#445) from feat-IRONFANS-120-Robin into test
Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/445
This commit is contained in:
commit
8e144dfd7a
|
@ -526,14 +526,13 @@ func (m *Mysql) GetZoneMomentUnlockList(ctx *gin.Context, tx *sqlx.Tx, momentId
|
|||
func (m *Mysql) GetLastHourZoneProfit(ctx *gin.Context, tx *sqlx.Tx, st, et int64) (list []*dbstruct.ZoneProfit, err error) {
|
||||
var sql strings.Builder
|
||||
sql.WriteString(fmt.Sprintf("select uid as mid, oid1 as zid, product_id, count(1) as num, sum(pay_amount) as amount from %s", TableOrder))
|
||||
sql.WriteString(fmt.Sprintf(" where ct >=%d and ct<=%d and product_id in(%s,%s,%s,%s) and order_status = 1 group by product_id, uid, oid1", st, et,
|
||||
dbstruct.ProductIdH5ZoneMoment, dbstruct.ProductIdH5ZoneAdmission, dbstruct.ProductIdH5ZoneIronfanship, dbstruct.ProductIdH5ZoneSuperfanship))
|
||||
sql.WriteString(fmt.Sprintf(" where ct >=%d and ct<=%d and product_id in(?,?,?,?) and order_status = 1 group by product_id, uid, oid1", st, et))
|
||||
list = make([]*dbstruct.ZoneProfit, 0)
|
||||
if tx != nil {
|
||||
err = tx.SelectContext(ctx, &list, sql.String())
|
||||
err = tx.SelectContext(ctx, &list, sql.String(), dbstruct.ProductIdH5ZoneMoment, dbstruct.ProductIdH5ZoneAdmission, dbstruct.ProductIdH5ZoneIronfanship, dbstruct.ProductIdH5ZoneSuperfanship)
|
||||
} else {
|
||||
db := m.getDBVas()
|
||||
err = db.SelectContext(ctx, &list, sql.String())
|
||||
err = db.SelectContext(ctx, &list, sql.String(), dbstruct.ProductIdH5ZoneMoment, dbstruct.ProductIdH5ZoneAdmission, dbstruct.ProductIdH5ZoneIronfanship, dbstruct.ProductIdH5ZoneSuperfanship)
|
||||
}
|
||||
if err != nil {
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue