ProcessRecordsLogic.php
2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
namespace App\Http\Logic\Aside\Project;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Project\ProcessRecords;
use App\Models\Project\Project;
class ProcessRecordsLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->param = $this->requestAll;
$this->model = new ProcessRecords();
}
public function getInfo($project_id)
{
$data = $this->model->read(['project_id'=>$project_id]);
$project = ProjectLogic::instance()->getProjectInfo($project_id);
if(!$data){
$data = [
'project_id' => $project_id,
'record' => [],
'remark' => '',
];
}
$data['project_company'] = $project['company'] ?? '';
$data['project_plan'] = Project::planMap()[$project['deploy_build']['plan']];
$data['project_service_duration'] = $project['deploy_build']['service_duration'] ?? '';
$data['domain'] = $project['deploy_optimize']['domain'] ?? '';
$data['test_domain'] = $project['deploy_build']['test_domain'] ?? '';
$data['login_mobile'] = $project['deploy_build']['login_mobile'] ?? '';
$data['data_source'] = [
[
'type' => '基础资料',
'item' => ['Logo', 'banner素材', '基本信息', '公司介绍', '新闻']
],
[
'type' => '产品资料',
'item' => ['都未准备', '不足10款', '描述较少', '重复度过高']
],
[
'type' => '关键词/域名',
'item' => ['未提供', '筛选中', '未盖章', '域名未确认']
],
[
'type' => '建站进度',
'item' => ['资料上传', '网站修改中', '网站搭建完成,客户确认中', '等待网站品控审核后上线']
]
];
return $this->success($data);
}
public function recordSave(){
$info = $this->model->read(['project_id'=>$this->param['project_id']]);
$this->param['operator_id'] = $this->manager['id'];
$this->param['record'] = json_encode($this->param['record']);
if($info === false){
$res = $this->model->add($this->param);
}else{
$res = $this->model->edit($this->param,['id'=>$info['id']]);
}
if($res === false){
$this->fail('保存失败');
}
return $this->success();
}
}