From 0f284cf9b317f3c14c1995d6ae2227060d5cd49b Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 28 Jul 2020 16:48:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B8=B8=E6=88=8F=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=EF=BC=8C=E5=B7=B2=E7=BB=8F=E7=BB=91=E5=AE=9A=E4=B8=8D?= =?UTF-8?q?=E5=87=BA=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyRelationController.class.php | 34 +++++++++++++++++-- .../Admin/View/CpJuheCompany/index.html | 3 ++ Data/update.sql | 3 -- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/Application/Admin/Controller/CompanyRelationController.class.php b/Application/Admin/Controller/CompanyRelationController.class.php index 75cceab18..1f459515f 100644 --- a/Application/Admin/Controller/CompanyRelationController.class.php +++ b/Application/Admin/Controller/CompanyRelationController.class.php @@ -561,13 +561,22 @@ class CompanyRelationController extends AdminController //己方公司 $companyInfo = M("CompanyInfo","tab_")->field("id,partner company_name,link_man,link_phone")->where("status='1'")->select(); } + $b = $this->getBindCompanyId($type); + if($b){ + $map = [ + "id"=>["NOT IN",$b] + ]; + }else{ + $map = false; + } + if($type == 1){ //上游 - $companyInfo = M("Partner","tab_")->field("id,partner company_name,company_type,link_man,link_phone")->where("status='1'")->select(); + $companyInfo = M("Partner","tab_")->where($map)->field("id,partner company_name,company_type,link_man,link_phone")->where("status='1'")->select(); } if($type == 2){ //下游游 - $companyInfo = M("PromoteCompany","tab_")->field("id,company_belong,company_name,company_type,settlement_contact link_man,contact_phone link_phone")->where("status='1'")->select(); + $companyInfo = M("PromoteCompany","tab_")->where($map)->field("id,company_belong,company_name,company_type,settlement_contact link_man,contact_phone link_phone")->where("status='1'")->select(); } foreach($companyInfo as $k=>&$v){ if(isset($v['company_belong'])){ @@ -608,6 +617,27 @@ class CompanyRelationController extends AdminController } return $companyInfo; } + /** + * 获取已绑定公司id + * @param [type] $type 1 上游 /2下游 + * @return void + */ + protected function getBindCompanyId($type){ + $dbres = M("CompanyRelation","tab_")->where("first_company_type = {$type} OR second_company_type = {$type}")->field("first_company_id,second_company_id")->select(); + if(empty($dbres)){ + return false; + }else{ + $sendid = []; + foreach ($dbres as $k => $v) { + if($v['first_company_type'] == $type){ + $sendid[] = $v['first_company_id']; + }else{ + $sendid[] = $v['second_company_id']; + } + } + return implode(",",$sendid); + } + } protected function listMenuAuth(){ $addurl = U("addRelation"); diff --git a/Application/Admin/View/CpJuheCompany/index.html b/Application/Admin/View/CpJuheCompany/index.html index d687d2ac4..e4415d866 100644 --- a/Application/Admin/View/CpJuheCompany/index.html +++ b/Application/Admin/View/CpJuheCompany/index.html @@ -65,6 +65,9 @@ visibility: visible; line-height: 20px; } + tr{ + border-bottom: 1px solid #e6e6e6; + } diff --git a/Data/update.sql b/Data/update.sql index de44e78e7..764f5718e 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -2397,10 +2397,7 @@ ADD COLUMN `confirm_log` text COMMENT '确认信息' AFTER `confirm_status`; ALTER TABLE `tab_company_statement` MODIFY COLUMN `verify_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '审核状态 -3:汇总驳回 -2:审核拒绝 -1管理员审批拒绝 0:系统生成 1:管理员审核通过 2:审核通过 3:汇总' AFTER `platform_amount`; -<<<<<<< HEAD -======= INSERT INTO `sys_kv`(`id`, `key`, `value`, `type`, `remark`) VALUES (4, 'cp_company_api', 'http://10.0.1.161:8095/index.php?g=Api&m=CpJuheCompany&a=index', 'string', '聚合公司网址') ALTER TABLE `sj_game_channel`.`sj_cptogether_company` ADD COLUMN `is_qualifity` tinyint(2) NULL COMMENT '是否具有游戏资质 0 否 1 是' AFTER `is_received`; ->>>>>>> c3417bdd834f9ac023945503b0b5250720b402e5