iferr:=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 >= \""+start+"\" AND p.created_time < \""+end+"\" group by user_id"+
" 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 >= \""+start+"\" AND d.created_time < \""+end+"\" group by receiver_id "+
" 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 >= \""+start+"\" AND d.created_time < \""+end+"\" group by receiver_id"+
") t group by code order by dollar DESC").Find(&charges).Error;err!=nil{
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"
sql:="select user_id,SUM(num) num FROM diamond_account_detail_202405 where operate_type in (69,39,117) AND created_time >= \""+start+"\" AND created_time < \""+end+"\" and user_id in ? group by user_id"