|
...
|
...
|
@@ -76,13 +76,13 @@ class VisualizationLogic extends BaseLogic |
|
|
|
*/
|
|
|
|
public function getSource($type){
|
|
|
|
$source_id = 0;
|
|
|
|
if ($type == 2){$source = 2;$source_id = 1;
|
|
|
|
}elseif ($type == 3){$source = 2;
|
|
|
|
}elseif ($type == 4){$source = 3;$source_id = 1;
|
|
|
|
}elseif ($type == 5){$source = 3;
|
|
|
|
}elseif ($type == 6){$source = 4;$source_id = 1;
|
|
|
|
}elseif ($type == 7){$source = 4;
|
|
|
|
}else{$source = 1;}
|
|
|
|
if ($type == BTemplate::TYPE_TWO){$source = BTemplate::SOURCE_PRODUCT;$source_id = 1;
|
|
|
|
}elseif ($type == BTemplate::TYPE_THREE){$source = BTemplate::SOURCE_PRODUCT;
|
|
|
|
}elseif ($type == BTemplate::TYPE_FOUR){$source = BTemplate::SOURCE_BLOG;$source_id = 1;
|
|
|
|
}elseif ($type == BTemplate::TYPE_FIVE){$source = BTemplate::SOURCE_BLOG;
|
|
|
|
}elseif ($type == BTemplate::TYPE_SIX){$source = BTemplate::SOURCE_NEWS;$source_id = 1;
|
|
|
|
}elseif ($type == BTemplate::TYPE_SEVEN){$source = BTemplate::SOURCE_NEWS;
|
|
|
|
}else{$source = BTemplate::SOURCE_HOME;}
|
|
|
|
return ['source'=>$source,'source_id'=>$source_id];
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -271,15 +271,15 @@ class VisualizationLogic extends BaseLogic |
|
|
|
* @time :2023/11/16 11:20
|
|
|
|
*/
|
|
|
|
public function getType($source,$source_id){
|
|
|
|
$type = 1;
|
|
|
|
if($source == 2){
|
|
|
|
if($source_id == 0){$type = 3;}else{$type = 2;}
|
|
|
|
$type = BTemplate::TYPE_ONE;
|
|
|
|
if($source == BTemplate::SOURCE_PRODUCT){
|
|
|
|
if($source_id == 0){$type = BTemplate::TYPE_THREE;}else{$type = BTemplate::TYPE_TWO;}
|
|
|
|
}
|
|
|
|
if($source == 3){
|
|
|
|
if($source_id == 0){$type = 5;}else{$type = 4;}
|
|
|
|
if($source == BTemplate::SOURCE_BLOG){
|
|
|
|
if($source_id == 0){$type = BTemplate::TYPE_FIVE;}else{$type = BTemplate::TYPE_FOUR;}
|
|
|
|
}
|
|
|
|
if($source == 4){
|
|
|
|
if($source_id == 0){$type = 7;}else{$type = 6;}
|
|
|
|
if($source == BTemplate::SOURCE_NEWS){
|
|
|
|
if($source_id == 0){$type = BTemplate::TYPE_SEVEN;}else{$type = BTemplate::TYPE_SIX;}
|
|
|
|
}
|
|
|
|
return $type;
|
|
|
|
}
|
|
...
|
...
|
@@ -412,7 +412,9 @@ class VisualizationLogic extends BaseLogic |
|
|
|
$this->param['main_html'] = characterTruncation($param['html'],'/<main\b[^>]*>(.*?)<\/main>/s');
|
|
|
|
$this->param['main_css'] = characterTruncation($param['html'],'/<style id="globalsojs-styles">(.*?)<\/style>/s');
|
|
|
|
//保存头部
|
|
|
|
$this->saveCommonTemplate($param['html'],$param['source'],$param['source_id'],$param['template_id']);
|
|
|
|
if($param['is_custom'] == BTemplate::SOURCE_NO_CUSTOM){//非扩展模块才可以保存头底
|
|
|
|
$this->saveCommonTemplate($param['html'],$param['source'],$param['source_id'],$param['template_id']);
|
|
|
|
}
|
|
|
|
if($templateInfo === false){
|
|
|
|
$param['project_id'] = $this->user['project_id'];
|
|
|
|
$bTemplateModel->add($param);
|
...
|
...
|
|