cond:="select merchant_name, agent_name, pay_product_name as supplier_name, pay_type_name, sum(fact_amount) as order_amount, count(1) as order_count, "+
"sum(platform_profit) as platform_profit, sum(agent_profit) as agent_profit from "+ORDER_PROFIT_INFO+" where status='success' "
flag:=false
fork,v:=rangeparams{
iflen(v)>0{
ifflag{
cond+=" and"
}
ifstrings.Contains(k,"create_time__gte"){
cond=cond+" create_time>='"+v+"'"
}elseifstrings.Contains(k,"create_time__lte"){
cond=cond+" create_time<='"+v+"'"
}else{
cond=cond+" "+k+"='"+v+"'"
}
flag=true
}
}
cond+=" group by merchant_uid, agent_uid, pay_product_code, pay_type_code"
varplatformProfitList[]PlatformProfit
_,err:=o.Raw(cond).QueryRows(&platformProfitList)
iferr!=nil{
logs.Error("get platform profit by map fail:",err)