添加公司上下级关联

This commit is contained in:
luofei 2023-07-21 10:08:58 +08:00
parent 9fe14c3414
commit a814c6a977
2 changed files with 9 additions and 0 deletions

View File

@ -58,6 +58,9 @@ class CompanyController extends BaseAdminController
$params['other_contacts'] = json_encode($params['other_contacts']);
$params['qualification'] = json_encode($params['qualification']);
$result = CompanyLogic::add($params);
if ($this->adminInfo['root'] != 1 && empty($params['contract']['party_a'])) {
return $this->fail('签约方不能为空');
}
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
@ -76,6 +79,9 @@ class CompanyController extends BaseAdminController
$params = (new CompanyValidate())->post()->goCheck('edit');
$params['other_contacts'] = json_encode($params['other_contacts']);
$params['qualification'] = json_encode($params['qualification']);
if ($this->adminInfo['root'] != 1 && empty($params['contract']['party_a'])) {
return $this->fail('签约方不能为空');
}
$result = CompanyLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);

View File

@ -70,6 +70,7 @@ class CompanyLogic extends BaseLogic
// 'deposit_time' => $params['deposit_time'],
'qualification' => $params['qualification'],
'admin_id' => $params['admin_id'] ?? 0,
'level_one' => $params['contract']['party_a'] ?? 0,
// 'status' => $params['status']
]);
self::contract($data['id'], $params);
@ -117,6 +118,8 @@ class CompanyLogic extends BaseLogic
// 'deposit' => $params['deposit'],
// 'deposit_time' => $params['deposit_time'],
'qualification' => $params['qualification'],
'admin_id' => $params['admin_id'] ?? 0,
'level_one' => $params['contract']['party_a'] ?? 0,
// 'status' => $params['status']
]);
self::contract($params['id'], $params);