修复多家公司合作问题

master
chenzhi 4 years ago
parent 701c421d0c
commit ffb60d80a9

@ -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
(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 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(); $hasdb = $this->DBModel->where($where)->find();
if(isset($hasdb['id'])){ if(isset($hasdb['id'])){

Loading…
Cancel
Save