From 8c191c2f0533ed442558b2afb922ac4ef7dc7625 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 21 Jul 2020 11:37:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8E=A8=E5=B9=BF=E5=91=98?= =?UTF-8?q?=E5=85=AC=E5=8F=B8=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteCompanyController.class.php | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 8d84dded3..0dfdf46f0 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -1060,6 +1060,7 @@ class PromoteCompanyController extends ThinkController } } } + if(empty($game_arr)){ return $this->getPromoteGameRadio($company_id,$senddata); } @@ -1092,7 +1093,8 @@ class PromoteCompanyController extends ThinkController } foreach($game_arr as $k=>$v){ - $senddata[$k]= ["turnover_ratio"=>[["name"=>"--","ratio"=>"--"]],"ratio"=>0,"relation_game_id"=>$k,"cp_ratio"=>[["name"=>"--","ratio"=>"--"]],"row"=>1,"relation_game_name"=>"--","game_type_name"=>"--"]; + $senddata[$k]= ["turnover_ratio"=>[["name"=>"--","ratio"=>"--"]],"ratio"=>0,"relation_game_id"=>$k,"cp_ratio"=>[["name"=>"--","ratio"=>"--"]],"row"=>1]; + $senddata[$k]+= $game[$k];; } return $this->getPromoteGameRadio($company_id,$senddata); } @@ -1122,6 +1124,8 @@ class PromoteCompanyController extends ThinkController }else{ $v['list'] = []; $v['row']=0; + $v['game_ids'] = $this->changeGameidToRelationGameid($v['game_ids']); + $game_arr = array_flip(explode(",",$v['game_ids'])); foreach($game_arr as $ke=>$va){ if(isset($ratio[$ke])){ @@ -1191,18 +1195,21 @@ class PromoteCompanyController extends ThinkController } //获取游戏基础信息 protected function getGameInfo($game_ids){ + $gameinfo = []; - $dbres = M("Game","tab_")->where("id in ($game_ids)")->field("relation_game_id,relation_game_name,game_type_name")->select(); + $dbres = M("Game","tab_")->where("relation_game_id in ($game_ids)")->field("relation_game_id,relation_game_name,game_type_name")->group("relation_game_id")->select(); foreach($dbres as $k=>$v){ $gameinfo[$v['relation_game_id']] = $v; } return $gameinfo; } - //无游戏id获取比例 - protected function noGameidsGetPromote($company_id){ - - } - + //普通游戏id转唯一游戏id + protected function changeGameidToRelationGameid($ids) + { + $rid = M('game', 'tab_')->field('relation_game_id')->where(["id"=>["in",$ids]])->group("relation_game_id")->select(); + return implode(",",array_column($rid,'relation_game_id')); + } + }