|
|
@ -302,18 +302,18 @@ class CompanyRelationController extends AdminController
|
|
|
|
unset($v['remark']);
|
|
|
|
unset($v['remark']);
|
|
|
|
unset($v['status']);
|
|
|
|
unset($v['status']);
|
|
|
|
unset($v['verify_log']);
|
|
|
|
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 = "
|
|
|
|
$where = "
|
|
|
|
(
|
|
|
|
(first_company_type ='{$t_company_type}' and first_company_id = '{$t_company_id}')
|
|
|
|
(first_company_type ='{$v['first_company_type']}' and first_company_id = '{$v['first_company_id']}')
|
|
|
|
|
|
|
|
OR
|
|
|
|
OR
|
|
|
|
(first_company_type ='{$v['second_company_type']}' and first_company_id = '{$v['second_company_id']}')
|
|
|
|
(second_company_type ='{$t_company_type}' and second_company_id = '{$t_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']}')
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
";
|
|
|
|
";
|
|
|
|
$hasdb = $this->DBModel->where($where)->find();
|
|
|
|
$hasdb = $this->DBModel->where($where)->find();
|
|
|
|
if(isset($hasdb['id'])){
|
|
|
|
if(isset($hasdb['id'])){
|
|
|
|