修改公司信息保存
This commit is contained in:
parent
98ea371089
commit
bb3f965dba
@ -73,7 +73,8 @@ class CompanyLogic extends BaseLogic
|
|||||||
'level_one' => $params['contract']['party_a'] ?? 0,
|
'level_one' => $params['contract']['party_a'] ?? 0,
|
||||||
// 'status' => $params['status']
|
// 'status' => $params['status']
|
||||||
]);
|
]);
|
||||||
self::contract($data['id'], $params);
|
$contractId = self::contract($data['id'], $params);
|
||||||
|
Company::update(['contract_id' => $contractId], ['id' => $data['id']]);
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return true;
|
return true;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -123,7 +124,8 @@ class CompanyLogic extends BaseLogic
|
|||||||
// 'status' => $params['status']
|
// 'status' => $params['status']
|
||||||
]);
|
]);
|
||||||
if($params['contract']){
|
if($params['contract']){
|
||||||
self::contract($params['id'], $params);
|
$contractId = self::contract($params['id'], $params);
|
||||||
|
Company::update(['contract_id' => $contractId], ['id' => $params['id']]);
|
||||||
}
|
}
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return true;
|
return true;
|
||||||
@ -178,14 +180,18 @@ class CompanyLogic extends BaseLogic
|
|||||||
$model = Contract::where(['party_b'=>$companyId])->find();
|
$model = Contract::where(['party_b'=>$companyId])->find();
|
||||||
if (empty($model)) {
|
if (empty($model)) {
|
||||||
$model = new Contract();
|
$model = new Contract();
|
||||||
$model->party_b = $companyId;
|
|
||||||
$model->contract_no = time();
|
$model->contract_no = time();
|
||||||
$model->create_time = time();
|
$model->create_time = time();
|
||||||
$model->type = 1;
|
$model->type = 1;
|
||||||
}
|
}
|
||||||
$model->update_time = time();
|
$model->update_time = time();
|
||||||
$model->setAttrs($params['contract']);
|
$model->setAttrs($params['contract']);
|
||||||
|
$model->admin_id = $params['admin_id'];
|
||||||
|
$model->company_id = $companyId;
|
||||||
|
$model->party_a = $params['party_a'] ?? 0;
|
||||||
|
$model->party_b = $companyId;
|
||||||
$model->save();
|
$model->save();
|
||||||
|
return $model->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getAllCompanyIds()
|
public static function getAllCompanyIds()
|
||||||
|
@ -56,6 +56,7 @@ class AdminLogic extends BaseLogic
|
|||||||
$params['avatar'] = $avatar;
|
$params['avatar'] = $avatar;
|
||||||
$params['password'] = $password;
|
$params['password'] = $password;
|
||||||
$params['create_time'] = time();
|
$params['create_time'] = time();
|
||||||
|
$params['company_id'] = $params['party_a'];
|
||||||
$admin_id = Admin::strict(false)->field(true)->insertGetId($params);
|
$admin_id = Admin::strict(false)->field(true)->insertGetId($params);
|
||||||
// 角色
|
// 角色
|
||||||
self::insertRole($admin_id, explode(',',$params['role_id']) ?? []);
|
self::insertRole($admin_id, explode(',',$params['role_id']) ?? []);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user