|
@@ -56,19 +56,16 @@ class ProcessRecordsLogic extends BaseLogic |
|
@@ -56,19 +56,16 @@ class ProcessRecordsLogic extends BaseLogic |
|
56
|
}
|
56
|
}
|
|
57
|
|
57
|
|
|
58
|
public function save($param){
|
58
|
public function save($param){
|
|
59
|
- $info = $this->model->select(['project_id', 'record', 'remark'])->where('project_id', $param['project_id'])->first();
|
|
|
|
60
|
- if($info){
|
|
|
|
61
|
- $this->model = $info;
|
|
|
|
62
|
- }
|
|
|
|
63
|
- $this->model->project_id = $param['project_id'];
|
|
|
|
64
|
- $this->model->record = $param['record'];
|
|
|
|
65
|
- $this->model->remark = $param['remark'];
|
|
|
|
66
|
- $this->model->operator_id = $param['operator_id'];
|
|
|
|
67
|
- $res = $this->model->save();
|
|
|
|
68
|
- if($res){
|
|
|
|
69
|
- return $this->success(['project_id' => $this->model->project_id]);
|
59
|
+ $info = $this->model->read(['project_id'=>$param['project_id']]);
|
|
|
|
60
|
+ $this->param['operator_id'] = $this->manage['id'];
|
|
|
|
61
|
+ if($info === false){
|
|
|
|
62
|
+ $res = $this->model->add($param);
|
|
70
|
}else{
|
63
|
}else{
|
|
|
|
64
|
+ $res = $this->model->edit($param,['id'=>$info['id']]);
|
|
|
|
65
|
+ }
|
|
|
|
66
|
+ if($res === false){
|
|
71
|
$this->fail('保存失败');
|
67
|
$this->fail('保存失败');
|
|
72
|
}
|
68
|
}
|
|
|
|
69
|
+ return $this->success();
|
|
73
|
}
|
70
|
}
|
|
74
|
} |
71
|
} |