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