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:
chenhao 2024-05-16 16:00:44 +08:00
commit 8e144dfd7a
1 changed files with 3 additions and 4 deletions

View File

@ -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