作者 刘锟

update

@@ -16,6 +16,7 @@ use App\Models\Domain\DomainInfo; @@ -16,6 +16,7 @@ use App\Models\Domain\DomainInfo;
16 use App\Models\Product\Category; 16 use App\Models\Product\Category;
17 use App\Models\Project\ProjectUpdateTdk; 17 use App\Models\Project\ProjectUpdateTdk;
18 use App\Models\Template\BTemplate; 18 use App\Models\Template\BTemplate;
  19 +use App\Models\Template\Setting;
19 use App\Services\ProjectServer; 20 use App\Services\ProjectServer;
20 use Illuminate\Support\Facades\DB; 21 use Illuminate\Support\Facades\DB;
21 22
@@ -85,7 +86,9 @@ class UpdateController extends BaseController @@ -85,7 +86,9 @@ class UpdateController extends BaseController
85 //产品分类开启了可视化之后,不能重新采集 86 //产品分类开启了可视化之后,不能重新采集
86 $category_list = Category::where('project_id', $this->param['project_id'])->get(); 87 $category_list = Category::where('project_id', $this->param['project_id'])->get();
87 if ($category_list->count() > 0) { 88 if ($category_list->count() > 0) {
88 - $template_id = $this->getTemplateId(BTemplate::SOURCE_PRODUCT, BTemplate::IS_LIST);//获取模版id 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
89 foreach ($category_list as $category) { 92 foreach ($category_list as $category) {
90 if ($this->getIsRenovation(BTemplate::SOURCE_PRODUCT, BTemplate::IS_LIST, $template_id, $category['id']) == 1) { 93 if ($this->getIsRenovation(BTemplate::SOURCE_PRODUCT, BTemplate::IS_LIST, $template_id, $category['id']) == 1) {
91 //有分类开启了可视化 94 //有分类开启了可视化