正在显示
1 个修改的文件
包含
18 行增加
和
16 行删除
| @@ -83,21 +83,6 @@ class UpdateController extends BaseController | @@ -83,21 +83,6 @@ class UpdateController extends BaseController | ||
| 83 | $this->fail('非升级无法进行采集操作'); | 83 | $this->fail('非升级无法进行采集操作'); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | - //产品分类开启了可视化之后,不能重新采集 | ||
| 87 | - $category_list = Category::where('project_id', $this->param['project_id'])->get(); | ||
| 88 | - if ($category_list->count() > 0) { | ||
| 89 | - $bSettingModel = new Setting(); | ||
| 90 | - $template_info = $bSettingModel->read(['project_id' => $this->param['project_id']]); | ||
| 91 | - $template_id = $template_info ? $template_info['template_id'] : 0;//获取模版id | ||
| 92 | - foreach ($category_list as $category) { | ||
| 93 | - if ($this->getRenovation($this->param['project_id'], BTemplate::SOURCE_PRODUCT, BTemplate::IS_LIST, $template_id, $category['id']) == 1) { | ||
| 94 | - //有分类开启了可视化 | ||
| 95 | - $this->param['type'] = 0; | ||
| 96 | - break; | ||
| 97 | - } | ||
| 98 | - } | ||
| 99 | - } | ||
| 100 | - | ||
| 101 | $test_domain = $this->param['test_domain'] ?? ''; | 86 | $test_domain = $this->param['test_domain'] ?? ''; |
| 102 | if ($test_domain) { | 87 | if ($test_domain) { |
| 103 | $test_domain_arr = parse_url($test_domain); | 88 | $test_domain_arr = parse_url($test_domain); |
| @@ -111,6 +96,23 @@ class UpdateController extends BaseController | @@ -111,6 +96,23 @@ class UpdateController extends BaseController | ||
| 111 | $this->fail('已上线项目需填写采集的测试站域名'); | 96 | $this->fail('已上线项目需填写采集的测试站域名'); |
| 112 | } | 97 | } |
| 113 | 98 | ||
| 99 | + if ($this->param['type'] == 1) { | ||
| 100 | + //产品分类重采之前,判断产品分类是否开启了可视化 | ||
| 101 | + $category_list = Category::where('project_id', $this->param['project_id'])->get(); | ||
| 102 | + if ($category_list->count() > 0) { | ||
| 103 | + $bSettingModel = new Setting(); | ||
| 104 | + $template_info = $bSettingModel->read(['project_id' => $this->param['project_id']]); | ||
| 105 | + $template_id = $template_info ? $template_info['template_id'] : 0;//获取模版id | ||
| 106 | + foreach ($category_list as $category) { | ||
| 107 | + if ($this->getRenovation($this->param['project_id'], BTemplate::SOURCE_PRODUCT, BTemplate::IS_LIST, $template_id, $category['id']) == 1) { | ||
| 108 | + //有分类开启了可视化 | ||
| 109 | + $this->param['type'] = 0; | ||
| 110 | + break; | ||
| 111 | + } | ||
| 112 | + } | ||
| 113 | + } | ||
| 114 | + } | ||
| 115 | + | ||
| 114 | try { | 116 | try { |
| 115 | if ($this->param['old_collect'] == 1) { | 117 | if ($this->param['old_collect'] == 1) { |
| 116 | //现有数据需要重新采集页面 | 118 | //现有数据需要重新采集页面 |
| @@ -199,7 +201,7 @@ class UpdateController extends BaseController | @@ -199,7 +201,7 @@ class UpdateController extends BaseController | ||
| 199 | $this->response('采集任务添加成功'); | 201 | $this->response('采集任务添加成功'); |
| 200 | } | 202 | } |
| 201 | 203 | ||
| 202 | - public function getRenovation($project_id,$source, $is_list, $template_id, $id, $is_custom = 0) | 204 | + public function getRenovation($project_id, $source, $is_list, $template_id, $id, $is_custom = 0) |
| 203 | { | 205 | { |
| 204 | $webTemplateModel = new BTemplate(); | 206 | $webTemplateModel = new BTemplate(); |
| 205 | $param = [ | 207 | $param = [ |
-
请 注册 或 登录 后发表评论