From 6bb398bcc3de2b95b325f7c119872e5e107a6ca4 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 21 Jul 2020 15:46:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8B=E6=B8=B8=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteCompanyController.class.php | 41 +++++-- .../Admin/View/PromoteCompany/lists.html | 101 +++++++++--------- 2 files changed, 85 insertions(+), 57 deletions(-) diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 0dfdf46f0..ceb8ab474 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -6,6 +6,7 @@ use mysql_xdevapi\Exception; use User\Api\UserApi as UserApi; use OSS\OssClient; use OSS\Core\OSsException; +use Base\Service\PresidentDepositService; use Think\Controller; /** @@ -67,7 +68,11 @@ class PromoteCompanyController extends ThinkController //获取公司信息 if(!empty($companyres)){ foreach($companyres as $k=>&$v){ - + $tmpr = D("CompanyRelation")->getCompanyRelation(2,$value['id']); + $v["settlement_type"] = $tmpr['settlement_type']; + $v["company_belong"] = getCompanyBlong($v["company_belong"]); + $v["develop_type"] = getCompanyRelation($v["develop_type"]); + $v['company_type'] = $v['company_type'] == 2 ? '个人' : '公司'; //遍历获取游戏信息 if(empty($v["game_ids"])){ $game = $this->getPromoteGameRadio($v["id"],false); @@ -1100,32 +1105,49 @@ class PromoteCompanyController extends ThinkController } protected function getPromoteGameRadio($company_id,$ratio){ //获取会长信息 + $payWays = PresidentDepositService::$payWays; + $payTypes = PresidentDepositService::$payTypes; + $statusList = PresidentDepositService::$statusList; + $rdata = []; - $promotemap['company_id']=$company_id; - $promotemap['level'] = 1; + $promotemap['p.company_id']=$company_id; + $promotemap['p.level'] = 1; $company_row = 0; $promoteres = M("Promote","tab_") - ->field("id,company_id,account,game_ids") + ->alias('p') + ->field("p.id,p.company_id,p.account,p.game_ids,d.amount,IFNULL(d.pay_way,-1) pay_way,d.status,d.pay_type") + ->join("tab_president_deposit as d ON p.id = d.promote_id") ->where($promotemap) ->select(); - + // dd($promoteres); + $adminList = getMarketAdminsByPromoteIds(array_column($promoteres, 'id')); if(empty($promoteres)){ //无会长 - return ["list"=>["account" => "--","list" => ["turnover_ratio"=>[["name"=>"--","ratio"=>"--"]],"ratio"=>0,"relation_game_id"=>$k,"cp_ratio"=>[["name"=>"--","ratio"=>"--"]],"row"=>1,"relation_game_name"=>"--","game_type_name"=>"--"]],"row"=>1]; + return ["list"=>["account" => "--","list" => ["turnover_ratio"=>[["name"=>"--","ratio"=>"--"]],"ratio"=>0,"relation_game_id"=>$k,"cp_ratio"=>[["name"=>"--","ratio"=>"--"]],"row"=>1,"original_package_name"=>"--","relation_game_name"=>"--","game_type_name"=>"--"]],"row"=>1]; } foreach ($promoteres as $k => &$v) { + $v['market_admin_username'] = isset($adminList[$v['id']]) && $adminList[$v['id']]['admin'] ? $adminList[$v['id']]['admin']['username'] : '无'; + if($v['pay_way'] == -1){ + $v['pay_way'] = "--"; + $v['status'] = "--"; + $v['pay_type']="--"; + }else{ + $v['status'] = $statusList[$v['status']] ?? '--'; + $v['pay_type'] = $payTypes[$v['pay_type']] ?? '--'; + $v['pay_way'] = $payWays[$v['pay_way']] ?? '--'; + } + if($ratio == false || empty($v['game_ids'])){ $v['row']=1; - $v['list'] = ["turnover_ratio"=>[["name"=>"--","ratio"=>"--"]],"ratio"=>0,"relation_game_id"=>$k,"cp_ratio"=>[["name"=>"--","ratio"=>"--"]],"row"=>1,"relation_game_name"=>"--","game_type_name"=>"--"]; + $v['list'] = ["turnover_ratio"=>[["name"=>"--","ratio"=>"--"]],"ratio"=>0,"relation_game_id"=>$k,"cp_ratio"=>[["name"=>"--","ratio"=>"--"]],"row"=>1,"original_package_name"=>"--","relation_game_name"=>"--","game_type_name"=>"--"]; $rdata[] = $v; $company_row += $v['row']; }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])){ @@ -1136,6 +1158,7 @@ class PromoteCompanyController extends ThinkController $rdata[] = $v; $company_row += $v['row']; } + // dd($v); } return ["list"=>$rdata,"row"=>$company_row]; } @@ -1197,7 +1220,7 @@ class PromoteCompanyController extends ThinkController protected function getGameInfo($game_ids){ $gameinfo = []; - $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(); + $dbres = M("Game","tab_")->where("relation_game_id in ($game_ids)")->field("relation_game_id,relation_game_name,game_type_name,original_package_name")->group("relation_game_id")->select(); foreach($dbres as $k=>$v){ $gameinfo[$v['relation_game_id']] = $v; } diff --git a/Application/Admin/View/PromoteCompany/lists.html b/Application/Admin/View/PromoteCompany/lists.html index 5a9580807..fb0ff8ae3 100644 --- a/Application/Admin/View/PromoteCompany/lists.html +++ b/Application/Admin/View/PromoteCompany/lists.html @@ -125,12 +125,12 @@ 对应平台 内外团 开发类型 - 市场专员 公司性质 - 押金 结算周期 - 会长账号 + + 市场专员 + 押金 原包名 现包名 产品类型 @@ -150,42 +150,44 @@ {$data.company_name} 查看 - {$data.platform_name} + {$data.platform_name|default="--"} {$data.company_belong} {$data.develop_type} - {$data.uid} + {$data.company_type} - {$data.yj} - {$data.jszq} + + {$data.settlement_type} - {$data['list'][0]['account']} + {$data['list'][0]['account']|default="--"} + {$data['list'][0]['market_admin_username']|default="--"} + {$data['list'][0]['pay_type']|default="--"} - {$data['list'][0]['list'][0]['relation_game_name']} - {$data['list'][0]['list'][0]['relation_game_name']} - {$data['list'][0]['list'][0]['relation_game_name']} + {$data['list'][0]['list'][0]['original_package_name']|default="--"} + {$data['list'][0]['list'][0]['relation_game_name']|default="--"} + {$data['list'][0]['list'][0]['game_type_name']|default="--"} - {$data['list'][0]['list'][0]['turnover_ratio'][0]['name']} - {$data['list'][0]['list'][0]['turnover_ratio'][0]['ratio']} + {$data['list'][0]['list'][0]['turnover_ratio'][0]['name']|default="--"} + {$data['list'][0]['list'][0]['turnover_ratio'][0]['ratio']|default="--"} - - - - + -- + -- - - - - - - - - - - + -- + -- + -- + -- + -- - - - - - - - - - - - - + -- + -- + -- + -- + -- + -- @@ -202,8 +204,8 @@ - {$game_ratio['name']} - {$game_ratio['ratio']}% + {$game_ratio['name']|default="--"} + {$game_ratio['ratio']|default="--"}% @@ -216,14 +218,14 @@ - {$p_ratio['relation_game_name']} - {$p_ratio['relation_game_name']} - {$p_ratio['relation_game_name']} + {$p_ratio['original_package_name']|default="--"} + {$p_ratio['relation_game_name']|default="--"} + {$p_ratio['game_type_name']|default="--"} - {$p_ratio['turnover_ratio'][0]['name']} - {$p_ratio['turnover_ratio'][0]['ratio']} + {$p_ratio['turnover_ratio'][0]['name']|default="--"} + {$p_ratio['turnover_ratio'][0]['ratio']|default="--"} - - @@ -234,8 +236,8 @@ - {$game_ratio['name']} - {$game_ratio['ratio']}% + {$game_ratio['name']|default="--"} + {$game_ratio['ratio']|default="--"}% @@ -248,25 +250,28 @@ - {$promote['account']} + {$promote['account']|default="--"} + {$promote['market_admin_username']|default="--"} + {$promote['pay_type']|default="--"} + - {$promote['list']['relation_game_name']} - {$promote['list']['relation_game_name']} - {$promote['list']['relation_game_name']} + {$promote['list']['original_package_name']|default="--"} + {$promote['list']['relation_game_name']|default="--"} + {$promote['list']['game_type_name']|default="--"} - {$promote['list']['turnover_ratio'][0]['name']} - {$promote['list']['turnover_ratio'][0]['ratio']} + {$promote['list']['turnover_ratio'][0]['name']|default="--"} + {$promote['list']['turnover_ratio'][0]['ratio']|default="--"} - - - - + -- + -- - - - - - - - - - - + -- + -- + -- + -- + --