From ffb60d80a9331329b4cac706ee1f6862c7b5e1f9 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 19 Jun 2020 11:03:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=9A=E5=AE=B6=E5=85=AC?= =?UTF-8?q?=E5=8F=B8=E5=90=88=E4=BD=9C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyRelationController.class.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Application/Admin/Controller/CompanyRelationController.class.php b/Application/Admin/Controller/CompanyRelationController.class.php index 12461b49e..c4f129e25 100644 --- a/Application/Admin/Controller/CompanyRelationController.class.php +++ b/Application/Admin/Controller/CompanyRelationController.class.php @@ -302,18 +302,18 @@ class CompanyRelationController extends AdminController unset($v['remark']); unset($v['status']); unset($v['verify_log']); + //判断公司id及类型 + if($v['first_company_type'] == 0){ + $t_company_id = $v['second_company_id']; + $t_company_type = $v['second_company_type']; + }else{ + $t_company_id = $v['first_company_id']; + $t_company_type = $v['first_company_type']; + } $where = " - ( - (first_company_type ='{$v['first_company_type']}' and first_company_id = '{$v['first_company_id']}') + (first_company_type ='{$t_company_type}' and first_company_id = '{$t_company_id}') OR - (first_company_type ='{$v['second_company_type']}' and first_company_id = '{$v['second_company_id']}') - ) - AND - ( - (second_company_type ='{$v['first_company_type']}' and second_company_id = '{$v['first_company_id']}') - OR - (second_company_type ='{$v['second_company_type']}' and second_company_id = '{$v['second_company_id']}') - ) + (second_company_type ='{$t_company_type}' and second_company_id = '{$t_company_id}') "; $hasdb = $this->DBModel->where($where)->find(); if(isset($hasdb['id'])){