|
...
|
...
|
@@ -504,7 +504,6 @@ class BTemplateLogic extends BaseLogic |
|
|
|
public function saveTemplateCom($html,$template_id,$source,$is_list,$is_custom){
|
|
|
|
$typeArr = [BTemplate::COMMON_HEAD, BTemplate::COMMON_FOOTER, BTemplate::COMMON_OTHER];
|
|
|
|
$handleInfo = $this->handleCommonParam($html);
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($handleInfo, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
$templateComModel = new BTemplateCom();
|
|
|
|
foreach ($typeArr as $type){
|
|
|
|
if($type == BTemplate::COMMON_HEAD){
|
|
...
|
...
|
@@ -523,11 +522,10 @@ class BTemplateLogic extends BaseLogic |
|
|
|
$condition = ['project_id'=>$this->user['project_id'],'template_id'=>$template_id,'is_list'=>$is_list,'is_custom'=>$is_custom,'source'=>$typeSource,'common_type'=>$type];
|
|
|
|
$info = $templateComModel->read($condition);
|
|
|
|
if($info === false){
|
|
|
|
$param = array_merge($param,$condition);
|
|
|
|
$templateComModel->add($param);
|
|
|
|
$data = array_merge($param,$condition);
|
|
|
|
$templateComModel->add($data);
|
|
|
|
}else{
|
|
|
|
$templateComModel->edit($param,$condition);
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($condition, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->success();
|
...
|
...
|
|