|
...
|
...
|
@@ -10,7 +10,11 @@ |
|
|
|
namespace App\Http\Logic\Bside\BTemplate;
|
|
|
|
|
|
|
|
use App\Http\Logic\Bside\BaseLogic;
|
|
|
|
use App\Models\Blog\Blog;
|
|
|
|
use App\Models\News\News;
|
|
|
|
use App\Models\Product\Product;
|
|
|
|
use App\Models\Project\PageSetting;
|
|
|
|
use App\Models\RouteMap\RouteMap;
|
|
|
|
use App\Models\Service\Service as ServiceSettingModel;
|
|
|
|
use App\Models\Template\BTemplate;
|
|
|
|
use App\Models\Template\BTemplateCommon;
|
|
...
|
...
|
@@ -285,12 +289,14 @@ class VisualizationLogic extends BaseLogic |
|
|
|
'source'=>$this->param['source'],
|
|
|
|
'project_id'=>$this->user['project_id'],
|
|
|
|
'source_id'=>$this->param['source_id'],
|
|
|
|
'template_id'=>0
|
|
|
|
]);
|
|
|
|
if($templateInfo === false){
|
|
|
|
$this->param['project_id'] = $this->user['project_id'];
|
|
|
|
$this->param['template_id'] = 0;
|
|
|
|
$bTemplateModel->add($this->param);
|
|
|
|
}else{
|
|
|
|
$bTemplateModel->edit(['html'=>$this->param['html']],['source'=>$this->param['source'],'source_id'=>$this->param['source_id']]);
|
|
|
|
$bTemplateModel->edit(['html'=>$this->param['html']],['source'=>$this->param['source'],'source_id'=>$this->param['source_id'],'template_id'=>0]);
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
$bTemplateModel = new BTemplate();
|
|
...
|
...
|
@@ -311,6 +317,7 @@ class VisualizationLogic extends BaseLogic |
|
|
|
$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']);
|
|
|
|
$this->homeOrProduct($this->param['source'],$this->param['source_id']);
|
|
|
|
}
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('系统错误,请联系管理员');
|
|
...
|
...
|
@@ -320,6 +327,45 @@ class VisualizationLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :通知首页更新
|
|
|
|
* @name :IsHome
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/7/31 16:05
|
|
|
|
*/
|
|
|
|
public function homeOrProduct($source,$source_id = ''){
|
|
|
|
if($source == BTemplate::SOURCE_HOME){
|
|
|
|
$type = 'index';
|
|
|
|
$route = '';
|
|
|
|
//路由映射
|
|
|
|
RouteMap::setRoute('index', RouteMap::SOURCE_PAGE, 0, $this->user['project_id']);
|
|
|
|
}else{
|
|
|
|
//其他界面通知更新
|
|
|
|
if($source == 2 && $source_id != 0){
|
|
|
|
$type = RouteMap::SOURCE_PRODUCT;
|
|
|
|
$productModel = new Product();
|
|
|
|
$productInfo = $productModel->read(['id'=>$source_id],['route']);
|
|
|
|
$route = $productInfo['route'];
|
|
|
|
}elseif($source == 3 && $source_id != 0){
|
|
|
|
$type = RouteMap::SOURCE_BLOG;
|
|
|
|
$blogModel = new Blog();
|
|
|
|
$blogInfo = $blogModel->read(['id'=>$source_id],['url']);
|
|
|
|
$route = $blogInfo['url'];
|
|
|
|
}elseif($source == 4 && $source_id != 0){
|
|
|
|
$type = RouteMap::SOURCE_NEWS;
|
|
|
|
$newsModel = new News();
|
|
|
|
$newsInfo = $newsModel->read(['id'=>$source_id],['url']);
|
|
|
|
$route = $newsInfo['url'];
|
|
|
|
}else{
|
|
|
|
$type = 0;
|
|
|
|
$route = 'all';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->addUpdateNotify($type,$route);
|
|
|
|
return $this->curlDelRoute($route);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :生成记录
|
|
|
|
* @name :setTemplateLog
|
|
|
|
* @author :lyh
|
...
|
...
|
|