作者 赵彬吉

update

... ... @@ -111,7 +111,7 @@ class ProjectController extends BaseController
'project_id.required' => '项目ID不能为空'
]);
$data = $logic->getInfo($this->param['project_id']);
return $this->success($data ? $data->toArray() : []);
return $this->success($data);
}
/**
... ... @@ -120,6 +120,7 @@ class ProjectController extends BaseController
* @date 2023/6/25
*/
public function save_process_records(ProcessRecordsRequest $request, ProcessRecordsLogic $logic){
$this->param['operator_id'] = $this->manage['id'];
$data = $logic->save($this->param);
return $this->success($data);
}
... ...
... ... @@ -17,19 +17,48 @@ class ProcessRecordsLogic extends BaseLogic
public function getInfo($project_id)
{
return $this->model->where('project_id', $project_id)->first();
$data = $this->model->select(['project_id', 'record', 'remark'])->where('project_id', $project_id)->first();
if(!$data){
$data = [
'project_id' => $project_id,
'record' => [],
'remark' => '',
];
}else{
$data = $data->toArray();
}
$data['data_source'] = [
[
'type' => '基础资料',
'item' => ['Logo', 'banner素材', '基本信息', '公司介绍', '新闻']
],
[
'type' => '产品资料',
'item' => ['都未准备', '不足10款', '描述较少', '重复度过高']
],
[
'type' => '关键词/域名',
'item' => ['未提供', '筛选中', '未盖章', '域名未确认']
],
[
'type' => '建站进度',
'item' => ['资料上传', '网站修改中', '网站搭建完成,客户确认中', '等待网站品控审核后上线']
]
];
return $this->success($data);
}
public function save($param){
$info = $this->getInfo($param['project_id']);
$info = $this->model->select(['project_id', 'record', 'remark'])->where('project_id', $param['project_id'])->first();
if($info){
$this->model = $info;
}
$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(['id' => $this->model->id]); //返回保存的数据id
return $this->success(['project_id' => $this->model->project_id]);
}else{
$this->fail('保存失败');
}
... ...