|
...
|
...
|
@@ -44,4 +44,58 @@ class VisualizationLogic extends BaseLogic |
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :可视化装修获取html
|
|
|
|
* @name :getHtml
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/11/15 11:30
|
|
|
|
*/
|
|
|
|
public function getHtml(){
|
|
|
|
//查询可视化是否第一次保存
|
|
|
|
$bTemplateModel = new BTemplate();
|
|
|
|
$TemplateInfo = $bTemplateModel->read([
|
|
|
|
'source'=>$this->param['source'],
|
|
|
|
'project_id'=>$this->user['project_id'],
|
|
|
|
'source_id'=>$this->param['source_id'],
|
|
|
|
]);
|
|
|
|
if($TemplateInfo === false){
|
|
|
|
$info = $this->model->read(['source'=>$this->map['source']],['html','source','id','project_id']);
|
|
|
|
if($info === false){
|
|
|
|
$this->fail('请先上传定制代码块');
|
|
|
|
}
|
|
|
|
return $info['html'];
|
|
|
|
}
|
|
|
|
return $TemplateInfo['html'];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存定制项目可视化
|
|
|
|
* @name :saveHtml
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/11/15 11:47
|
|
|
|
*/
|
|
|
|
public function saveHtml(){
|
|
|
|
$bTemplateModel = new BTemplate();
|
|
|
|
$templateInfo = $bTemplateModel->read([
|
|
|
|
'source'=>$this->param['source'],
|
|
|
|
'project_id'=>$this->user['project_id'],
|
|
|
|
'source_id'=>$this->param['source_id'],
|
|
|
|
]);
|
|
|
|
try {
|
|
|
|
if($templateInfo === false){
|
|
|
|
$bTemplateModel->add($this->param);
|
|
|
|
}else{
|
|
|
|
$bTemplateModel->edit(['html'=>$this->param['html']],['source'=>$this->param['source'],'source_id'=>$this->param['source_id']]);
|
|
|
|
}
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('系统错误请联系管理员');
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
...
|
...
|
|