|
...
|
...
|
@@ -56,19 +56,16 @@ class ProcessRecordsLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
public function save($param){
|
|
|
|
$info = $this->model->select(['project_id', 'record', 'remark'])->where('project_id', $param['project_id'])->first();
|
|
|
|
if($info){
|
|
|
|
$this->model = $info;
|
|
|
|
}
|
|
|
|
$this->model->project_id = $param['project_id'];
|
|
|
|
$this->model->record = $param['record'];
|
|
|
|
$this->model->remark = $param['remark'];
|
|
|
|
$this->model->operator_id = $param['operator_id'];
|
|
|
|
$res = $this->model->save();
|
|
|
|
if($res){
|
|
|
|
return $this->success(['project_id' => $this->model->project_id]);
|
|
|
|
$info = $this->model->read(['project_id'=>$param['project_id']]);
|
|
|
|
$this->param['operator_id'] = $this->manage['id'];
|
|
|
|
if($info === false){
|
|
|
|
$res = $this->model->add($param);
|
|
|
|
}else{
|
|
|
|
$res = $this->model->edit($param,['id'=>$info['id']]);
|
|
|
|
}
|
|
|
|
if($res === false){
|
|
|
|
$this->fail('保存失败');
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|