@ -1592,13 +1599,13 @@ class QueryController extends ThinkController
->select(false);
$count = M()->table('('.$data.') as a')
->field("my_time,pay_amount,game_id,game_names,promote_id,promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account")
->join("left join tab_promote on root_id = tab_promote.id")
->group("my_time,game_names,root_id")
->where($map)
->order("my_time Desc")
->select(false);
// $count = M()->table('('.$data.') as a')
// ->field("my_time,pay_amount,game_id,game_names,promote_id,promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account")
// ->join("left join tab_promote on root_id = tab_promote.id")
// ->group("my_time,game_names,root_id")
// ->where($map)
// ->order("my_time Desc")
// ->select(false);
//关联表获取会长账号名
$data = M()->table('('.$data.') as a')
@ -1606,16 +1613,15 @@ class QueryController extends ThinkController
->join("left join tab_promote on root_id = tab_promote.id")
->join("left join tab_promote_game_ratio as tab_ratio on tab_ratio.game_id = a.relation_game_id and tab_ratio.promote_id=root_id and tab_ratio.status=1")
// ->join("left join tab_cp_game_ratio as game_ratio on game_ratio.game_id = a.game_id")
->page($page,$row)
// ->page($page,$row)
->where($map)
->group("my_time,game_names,root_id")
->order("my_time Desc")
->select();
// var_dump($data);die();
// dump($data);die();
$pagecount = M()->table('('.$count.') as a')->count();
// $pagecount = M()->table('('.$count.') as a')->count();
foreach($data as $key => $value) {
$mytime = $value['my_time'];
@ -1655,9 +1661,14 @@ class QueryController extends ThinkController