作者 lyh

gx

... ... @@ -11,6 +11,7 @@ namespace App\Http\Controllers\Html;
use App\Http\Controllers\Controller;
use App\Models\Com\NoticeLog;
use App\Models\CustomModule\CustomModule;
use App\Models\Project\Project;
use App\Models\RouteMap\RouteMap;
use App\Models\Service\Service as ServiceSettingModel;
... ... @@ -53,13 +54,28 @@ class UpdateHtml extends Controller
* @method :post
* @time :2024/2/2 11:03
*/
public function getPageHtmlIsCustomized($source,$is_list){
public function getPageHtmlIsCustomized($source,$is_list,$is_custom){
if($is_custom == BTemplate::IS_CUSTOM){
$customModuleModel = new CustomModule();
$info = $customModuleModel->read(['id'=>$source]);
if($info === false){
$this->fail('当前扩展模块不存在或已被删除');
}
//扩展模块定制
if($is_list == BTemplate::IS_LIST && $info['list_customized'] == BTemplate::IS_VISUALIZATION){
return BTemplate::IS_VISUALIZATION;
}
if($is_list == BTemplate::IS_DETAIL && $info['detail_customized'] == BTemplate::IS_VISUALIZATION){
return BTemplate::IS_VISUALIZATION;
}
}else{
$type = $this->getCustomizedType($source, $is_list);//获取定制界面类型
//查看当前页面是否定制,是否开启可视化
$page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面
if (in_array($type, $page_array)) {//是定制界面
return BTemplate::IS_VISUALIZATION;
}
}
return BTemplate::IS_NO_VISUALIZATION;
}
... ... @@ -120,4 +136,37 @@ class UpdateHtml extends Controller
}
return $html;
}
/**
* @remark :定制页面头部类型---根据source获取type类型
* @name :getType
* @author :lyh
* @method :post
* @time :2023/11/16 11:20
*/
public function getCustomizedType($source,$is_list){
$type = BTemplate::TYPE_HOME;
if($source == BTemplate::SOURCE_PRODUCT){
if($is_list == BTemplate::IS_LIST){
$type = BTemplate::TYPE_PRODUCT_LIST;
}else{
$type = BTemplate::TYPE_PRODUCT_DETAIL;
}
}
if($source == BTemplate::SOURCE_BLOG){
if($is_list == BTemplate::IS_LIST){
$type = BTemplate::TYPE_BLOG_LIST;
}else{
$type = BTemplate::TYPE_BLOG_DETAIL;
}
}
if($source == BTemplate::SOURCE_NEWS){
if($is_list == BTemplate::IS_LIST){
$type = BTemplate::TYPE_NEWS_LIST;
}else{
$type = BTemplate::TYPE_NEWS_DETAIL;
}
}
return $type;
}
}
... ...
... ... @@ -131,8 +131,8 @@ class ProjectLogic extends BaseLogic
* @time :2023/8/30 11:57
*/
public function projectSave(){
DB::beginTransaction();
try {
// DB::beginTransaction();
// try {
$this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除
if($this->param['type'] == Project::TYPE_SEVEN){
//错误单直接返回,单独处理
... ... @@ -156,13 +156,14 @@ class ProjectLogic extends BaseLogic
$this->syncImageFile($this->param['project_location'],$this->param['id']);
//创建站点
// $this->createSite($this->param);
}
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('保存失败,请联系管理员');
}
(new SyncService())->projectAcceptAddress($this->param['id']);
}
// DB::commit();
// }catch (\Exception $e){
// DB::rollBack();
// $this->fail('保存失败,请联系管理员');
// }
return $this->success();
}
... ...