|
...
|
...
|
@@ -14,6 +14,7 @@ use App\Models\Project\PageSetting; |
|
|
|
use App\Models\Service\Service as ServiceSettingModel;
|
|
|
|
use App\Models\Template\BTemplate;
|
|
|
|
use App\Models\Template\BTemplateCommon;
|
|
|
|
use App\Models\Template\BTemplateLog;
|
|
|
|
use App\Models\Template\BTemplateMain;
|
|
|
|
use App\Models\Template\Setting;
|
|
|
|
use App\Models\Template\Template;
|
|
...
|
...
|
@@ -306,6 +307,7 @@ class VisualizationLogic extends BaseLogic |
|
|
|
}else{
|
|
|
|
$bTemplateModel->edit($this->param,['source'=>$this->param['source'],'source_id'=>$this->param['source_id']]);
|
|
|
|
}
|
|
|
|
$this->setTemplateLog($this->param['template_id'],$this->param['html'],$this->param['source'],$this->param['source_id']);
|
|
|
|
}
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('系统错误,请联系管理员');
|
|
...
|
...
|
@@ -315,6 +317,32 @@ class VisualizationLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :生成记录
|
|
|
|
* @name :setTemplateLog
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/23 11:16
|
|
|
|
*/
|
|
|
|
public function setTemplateLog($template_id,$html,$source,$source_id){
|
|
|
|
$data = [
|
|
|
|
'template_id'=>$template_id,
|
|
|
|
'project_id'=>$this->user['project_id'],
|
|
|
|
'operator_id'=>$this->user['id'],
|
|
|
|
'text'=>$html,
|
|
|
|
'source'=>$source,
|
|
|
|
'source_id'=>$source_id,
|
|
|
|
'main_html'=>characterTruncation($this->param['html'],'/<main\b[^>]*>(.*?)<\/main>/s'),
|
|
|
|
'main_css'=>characterTruncation($this->param['html'],'/<style id="globalsojs-styles">(.*?)<\/style>/s'),
|
|
|
|
'head_html'=>characterTruncation($html,'/<header\b[^>]*>(.*?)<\/header>/s'),
|
|
|
|
'head_css'=>characterTruncation($html,'/<style id="globalsojs-header">(.*?)<\/style>/s'),
|
|
|
|
'footer_html'=>characterTruncation($html,'/<footer\b[^>]*>(.*?)<\/footer>/s'),
|
|
|
|
'footer_css'=>characterTruncation($html,'/<style id="globalsojs-footer">(.*?)<\/style>/s'),
|
|
|
|
];
|
|
|
|
$bTemplateLogModel = new BTemplateLog();
|
|
|
|
return $bTemplateLogModel->add($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存头部公共数据
|
|
|
|
* @name :saveCommonTemplate
|
|
|
|
* @author :lyh
|
...
|
...
|
|