iferr:=mysql.ProdReadOnlyDB.Raw("select user_id,MAX(dollar) as dollar "+
"FROM (SELECT user_id,MAX(price) as dollar FROM `pay_order` WHERE `status` = '2' AND `type` = '0' AND created_time >= \"2022-07-01\" GROUP BY user_id "+
"union ALL SELECT receiver_id as user_id,MAX(dollar) as dollar FROM dealer_transfer_detail WHERE created_time >= \"2022-07-01\" GROUP BY receiver_id) t GROUP BY user_id").Find(&chargeUids).Error;err!=nil{
iferr:=mysql.ProdReadOnlyDB.Table("group_power_user").Where("group_power_id = ? AND role = 2",groupPowerId).Select("user_id").Scan(&ownerId).Error;err!=nil{
panic(err)
}
user,err:=GetUserById25(ownerId)
iferr!=nil{
panic(err)
}
returnuser.Code
}
funcGetCpCode(uiduint64)string{
typeCpstruct{
Iduint64
UserId1uint64
UserId2uint64
}
varcpCp
iferr:=mysql.ProdReadOnlyDB.Table("cp").Where("user_id1 = ? OR user_id2 = ?",uid,uid).Order("score DESC").Limit(1).First(&cp).Error;err!=nil{