作者 lyh
... ... @@ -83,21 +83,6 @@ class UpdateController extends BaseController
$this->fail('非升级无法进行采集操作');
}
//产品分类开启了可视化之后,不能重新采集
$category_list = Category::where('project_id', $this->param['project_id'])->get();
if ($category_list->count() > 0) {
$bSettingModel = new Setting();
$template_info = $bSettingModel->read(['project_id' => $this->param['project_id']]);
$template_id = $template_info ? $template_info['template_id'] : 0;//获取模版id
foreach ($category_list as $category) {
if ($this->getRenovation($this->param['project_id'], BTemplate::SOURCE_PRODUCT, BTemplate::IS_LIST, $template_id, $category['id']) == 1) {
//有分类开启了可视化
$this->param['type'] = 0;
break;
}
}
}
$test_domain = $this->param['test_domain'] ?? '';
if ($test_domain) {
$test_domain_arr = parse_url($test_domain);
... ... @@ -111,6 +96,23 @@ class UpdateController extends BaseController
$this->fail('已上线项目需填写采集的测试站域名');
}
if ($this->param['type'] == 1) {
//产品分类重采之前,判断产品分类是否开启了可视化
$category_list = Category::where('project_id', $this->param['project_id'])->get();
if ($category_list->count() > 0) {
$bSettingModel = new Setting();
$template_info = $bSettingModel->read(['project_id' => $this->param['project_id']]);
$template_id = $template_info ? $template_info['template_id'] : 0;//获取模版id
foreach ($category_list as $category) {
if ($this->getRenovation($this->param['project_id'], BTemplate::SOURCE_PRODUCT, BTemplate::IS_LIST, $template_id, $category['id']) == 1) {
//有分类开启了可视化
$this->param['type'] = 0;
break;
}
}
}
}
try {
if ($this->param['old_collect'] == 1) {
//现有数据需要重新采集页面
... ... @@ -199,7 +201,7 @@ class UpdateController extends BaseController
$this->response('采集任务添加成功');
}
public function getRenovation($project_id,$source, $is_list, $template_id, $id, $is_custom = 0)
public function getRenovation($project_id, $source, $is_list, $template_id, $id, $is_custom = 0)
{
$webTemplateModel = new BTemplate();
$param = [
... ...