作者 lyh

gx

... ... @@ -45,11 +45,21 @@ class VisualizationLogic extends BaseLogic
if(in_array($type,$typeArray)){
$bTemplateModel = new BTemplate();
$info = $bTemplateModel->read(['source'=>$source,'source_id'=>$source_id,'template_id'=>0]);
if($info === false){
$html = '';
}else{
$html = $info['html'];
}
}else{//模块数据
$bTemplateMainModel = new BTemplateMain();
$info = $bTemplateMainModel->read(['type'=>$type]);
if($info === false){
$html = '';
}else{
$html = $info['main_html'];
}
}
return $this->success($info);
return $this->success(['html'=>$html]);
}
public function getSource($type){
... ... @@ -72,7 +82,7 @@ class VisualizationLogic extends BaseLogic
* @time :2023/11/15 10:12
*/
public function saveVisualization(){
// try {
try {
$sourceData = $this->getSource($this->param['type']);
$source = $sourceData['source'];
$source_id = $sourceData['source_id'];
... ... @@ -106,9 +116,9 @@ class VisualizationLogic extends BaseLogic
$bTemplateMainModel->edit(['main_html'=>$this->param['html']],['id'=>$mainInfo['id']]);
}
}
// }catch (\Exception $e){
// $this->fail('系统错误,请联系管理员');
// }
}catch (\Exception $e){
$this->fail('系统错误,请联系管理员');
}
return $this->success();
}
... ...