Commit 6372fee0 authored by hujiebin's avatar hujiebin

Update fruit_slot_race_charge_history_sum.go

parent 563b55b2
...@@ -23,9 +23,9 @@ func main() { ...@@ -23,9 +23,9 @@ func main() {
var charges []FruitSlotRaceChargeHistoryData var charges []FruitSlotRaceChargeHistoryData
if err := mysql.ProdReadOnlyDB.Raw("select id as user_id,code,SUM(dollar) as dollar,country FROM " + if err := mysql.ProdReadOnlyDB.Raw("select id as user_id,code,SUM(dollar) as dollar,country FROM " +
"(select u.id,u.`code`,SUM(price) / 100 as dollar,u.country FROM pay_order p, `user` u where u.id = p.user_id AND p.`status` = 2 AND `type` = 0 AND p.created_time >= \"2024-04-29\" AND p.created_time < \"2024-05-06\" group by user_id" + "(select u.id,u.`code`,SUM(price) / 100 as dollar,u.country FROM pay_order p, `user` u where u.id = p.user_id AND p.`status` = 2 AND `type` = 0 AND p.created_time >= \"2024-04-29\" AND p.created_time < \"2024-05-06\" group by user_id" +
"UNION ALL " + " UNION ALL " +
"select u.id,u.code,SUM(dollar) / 100 as dollar,u.country FROM dealer_transfer_detail d, `user` u where u.id = d.receiver_id AND d.created_time >= \"2024-04-29\" AND d.created_time < \"2024-05-06\" group by receiver_id " + "select u.id,u.code,SUM(dollar) / 100 as dollar,u.country FROM dealer_transfer_detail d, `user` u where u.id = d.receiver_id AND d.created_time >= \"2024-04-29\" AND d.created_time < \"2024-05-06\" group by receiver_id " +
"UNION ALL " + " UNION ALL " +
"select u.id,u.code,SUM(dollar) / 100 as dollar,u.country FROM dealer_transfer_detail_pink d, `user` u where u.id = d.receiver_id AND d.created_time >= \"2024-04-29\" AND d.created_time < \"2024-05-06\" group by receiver_id" + "select u.id,u.code,SUM(dollar) / 100 as dollar,u.country FROM dealer_transfer_detail_pink d, `user` u where u.id = d.receiver_id AND d.created_time >= \"2024-04-29\" AND d.created_time < \"2024-05-06\" group by receiver_id" +
") t group by code order by dollar DESC").Find(&charges).Error; err != nil { ") t group by code order by dollar DESC").Find(&charges).Error; err != nil {
panic(err) panic(err)
...@@ -79,7 +79,7 @@ func GetBets(userIds []uint64) map[uint64]uint64 { ...@@ -79,7 +79,7 @@ func GetBets(userIds []uint64) map[uint64]uint64 {
} }
var bets []Bet var bets []Bet
res := make(map[uint64]uint64) res := make(map[uint64]uint64)
sql := "select user_id,SUM(num) num FROM diamond_account_detail_202405 where operate_type in (69,39,117) AND created_time >= \"2024-05-01\" AND created_time < \"2024-05-06\" and user_id in ?" sql := "select user_id,SUM(num) num FROM diamond_account_detail_202405 where operate_type in (69,39,117) AND created_time >= \"2024-05-01\" AND created_time < \"2024-05-06\" and user_id in ? group by user_id"
if err := mysql.ProdReadOnlyDB.Raw(sql, userIds).Find(&bets).Error; err != nil { if err := mysql.ProdReadOnlyDB.Raw(sql, userIds).Find(&bets).Error; err != nil {
panic(err) panic(err)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment