->join("left JOIN ({$gameres}) g ON m.relation_game_id = g.relation_game_id")
->join("left JOIN tab_promote_company p ON m.company_id = p.id")
->join("left JOIN tab_company_relation r ON (r.first_company_type =2 AND r.first_company_id = m.company_id) OR (r.second_company_type =2 AND r.second_company_id = m.company_id)")
->where($where);
if(isset($params['export'])){
$dbres = $dbres->select();
@ -54,7 +55,6 @@ class CompanyGameRatioController extends AdminController
->join("left JOIN ({$gameres}) g ON m.relation_game_id = g.relation_game_id")
->join("left JOIN tab_promote_company p ON m.company_id = p.id")
->join("left JOIN tab_company_relation r ON (r.first_company_type =2 AND r.first_company_id = m.company_id) OR (r.second_company_type =2 AND r.second_company_id = m.company_id)")
->where($where)
->order("FIELD(m.status,0,1,-1,-2,2),id desc");
if(isset($params['export'])){
@ -147,7 +153,11 @@ class CompanyGameRatioController extends AdminController