From ad2037408da8c66fb7272dc9e5549985af009c4a Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Tue, 25 Aug 2020 15:35:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteCompanyController.class.php | 43 ++++++++----------- .../Admin/View/PromoteCompany/lists.html | 8 ++-- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 1a0c14edd..54df7849f 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -73,18 +73,11 @@ class PromoteCompanyController extends ThinkController if (isset($_REQUEST['pay_type'])) { $pay_type = $_REQUEST['pay_type']; - $promote_id = M("president_deposit","tab_")->where("pay_type = '$pay_type'")->group("promote_id")->getField("promote_id",true); - if(empty($promote_id)){ - $promote_id = -1; - } - $promote_id = implode(",",$promote_id); - - $c_id = throwPromoteIdToCompanyId($promote_id); - if(isset($promotemap["_string"])){ - $promotemap["_string"] .= " ADN p.id in ($promote_id)"; - }else{ - $promotemap["_string"] = "p.id in ($promote_id)"; + $c_id = M("president_deposit","tab_")->where("pay_type = '$pay_type'")->group("company_id")->getField("company_id",true); + if(empty($c_id)){ + $c_id = -1; } + $c_id = implode(",", $c_id); if(isset($map["_string"])){ $map["_string"] .= " ADN id in ($c_id)"; }else{ @@ -109,11 +102,23 @@ class PromoteCompanyController extends ThinkController }else{ $companyres = $companyres->page($page,$row)->select(); } + + $payWays = PresidentDepositService::$payWays; + $payTypes = PresidentDepositService::$payTypes; + $statusList = PresidentDepositService::$statusList; + //获取公司信息 if(!empty($companyres)){ + + $companyIds = array_column($companyres, 'id') ; + $depositList = M('president_deposit', 'tab_')->field(['company_id', 'pay_type'])->where(['company_id' => ['in', $companyIds]])->select(); + $depositList = index_by_column('company_id', $depositList); + foreach($companyres as $k=>&$v){ + $deposit = $depositList[$v['id']] ?? null; $tmpr = D("CompanyRelation")->getCompanyRelation(2,$v['id']); $v["settlement_type"] = $tmpr['settlement_type']; + $v["deposit_pay_type"] = $deposit ? $payTypes[$deposit['pay_type']] : '--'; $v["collection"] = $tmpr['collection']; $v["invoice_type"] = $tmpr['invoice_type']; $v["invoice_content"] = $tmpr['invoice_content']; @@ -1333,10 +1338,6 @@ class PromoteCompanyController extends ThinkController } protected function getPromoteGameRadio($company_id,$ratio,$p_map = false){ //获取会长信息 - $payWays = PresidentDepositService::$payWays; - $payTypes = PresidentDepositService::$payTypes; - $statusList = PresidentDepositService::$statusList; - $rdata = []; $promotemap['p.company_id']=$company_id; $promotemap['p.level'] = 1; @@ -1347,8 +1348,7 @@ class PromoteCompanyController extends ThinkController $promoteres = M("Promote","tab_") ->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","left") + ->field("p.id,p.company_id,p.account,p.game_ids") ->where($promotemap) ->select(); // dd($promoteres); @@ -1360,15 +1360,6 @@ class PromoteCompanyController extends ThinkController 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; diff --git a/Application/Admin/View/PromoteCompany/lists.html b/Application/Admin/View/PromoteCompany/lists.html index b53da20de..020c945c0 100644 --- a/Application/Admin/View/PromoteCompany/lists.html +++ b/Application/Admin/View/PromoteCompany/lists.html @@ -152,12 +152,13 @@ 内外团 开发类型 公司性质 - 是否签署合同 + 是否
签署合同 结算周期 + 押金 会长账号 市场专员 - 押金 + 原包名 现包名 产品类型 @@ -185,10 +186,11 @@ {$data.is_sign_contact} {$data.settlement_type} + {$data.deposit_pay_type} {$data['list'][0]['account']|default="--"} {$data['list'][0]['market_admin_username']|default="--"} - {$data['list'][0]['pay_type']|default="--"} + {$data['list'][0]['list'][0]['original_package_name']|default="--"}