作者 lyh

gx

@@ -11,6 +11,7 @@ namespace App\Http\Controllers\Html; @@ -11,6 +11,7 @@ namespace App\Http\Controllers\Html;
11 11
12 use App\Http\Controllers\Controller; 12 use App\Http\Controllers\Controller;
13 use App\Models\Com\NoticeLog; 13 use App\Models\Com\NoticeLog;
  14 +use App\Models\CustomModule\CustomModule;
14 use App\Models\Project\Project; 15 use App\Models\Project\Project;
15 use App\Models\RouteMap\RouteMap; 16 use App\Models\RouteMap\RouteMap;
16 use App\Models\Service\Service as ServiceSettingModel; 17 use App\Models\Service\Service as ServiceSettingModel;
@@ -53,13 +54,28 @@ class UpdateHtml extends Controller @@ -53,13 +54,28 @@ class UpdateHtml extends Controller
53 * @method :post 54 * @method :post
54 * @time :2024/2/2 11:03 55 * @time :2024/2/2 11:03
55 */ 56 */
56 - public function getPageHtmlIsCustomized($source,$is_list){ 57 + public function getPageHtmlIsCustomized($source,$is_list,$is_custom){
  58 + if($is_custom == BTemplate::IS_CUSTOM){
  59 + $customModuleModel = new CustomModule();
  60 + $info = $customModuleModel->read(['id'=>$source]);
  61 + if($info === false){
  62 + $this->fail('当前扩展模块不存在或已被删除');
  63 + }
  64 + //扩展模块定制
  65 + if($is_list == BTemplate::IS_LIST && $info['list_customized'] == BTemplate::IS_VISUALIZATION){
  66 + return BTemplate::IS_VISUALIZATION;
  67 + }
  68 + if($is_list == BTemplate::IS_DETAIL && $info['detail_customized'] == BTemplate::IS_VISUALIZATION){
  69 + return BTemplate::IS_VISUALIZATION;
  70 + }
  71 + }else{
57 $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型 72 $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型
58 //查看当前页面是否定制,是否开启可视化 73 //查看当前页面是否定制,是否开启可视化
59 $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面 74 $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面
60 if (in_array($type, $page_array)) {//是定制界面 75 if (in_array($type, $page_array)) {//是定制界面
61 return BTemplate::IS_VISUALIZATION; 76 return BTemplate::IS_VISUALIZATION;
62 } 77 }
  78 + }
63 return BTemplate::IS_NO_VISUALIZATION; 79 return BTemplate::IS_NO_VISUALIZATION;
64 } 80 }
65 81
@@ -120,4 +136,37 @@ class UpdateHtml extends Controller @@ -120,4 +136,37 @@ class UpdateHtml extends Controller
120 } 136 }
121 return $html; 137 return $html;
122 } 138 }
  139 +
  140 + /**
  141 + * @remark :定制页面头部类型---根据source获取type类型
  142 + * @name :getType
  143 + * @author :lyh
  144 + * @method :post
  145 + * @time :2023/11/16 11:20
  146 + */
  147 + public function getCustomizedType($source,$is_list){
  148 + $type = BTemplate::TYPE_HOME;
  149 + if($source == BTemplate::SOURCE_PRODUCT){
  150 + if($is_list == BTemplate::IS_LIST){
  151 + $type = BTemplate::TYPE_PRODUCT_LIST;
  152 + }else{
  153 + $type = BTemplate::TYPE_PRODUCT_DETAIL;
  154 + }
  155 + }
  156 + if($source == BTemplate::SOURCE_BLOG){
  157 + if($is_list == BTemplate::IS_LIST){
  158 + $type = BTemplate::TYPE_BLOG_LIST;
  159 + }else{
  160 + $type = BTemplate::TYPE_BLOG_DETAIL;
  161 + }
  162 + }
  163 + if($source == BTemplate::SOURCE_NEWS){
  164 + if($is_list == BTemplate::IS_LIST){
  165 + $type = BTemplate::TYPE_NEWS_LIST;
  166 + }else{
  167 + $type = BTemplate::TYPE_NEWS_DETAIL;
  168 + }
  169 + }
  170 + return $type;
  171 + }
123 } 172 }
@@ -131,8 +131,8 @@ class ProjectLogic extends BaseLogic @@ -131,8 +131,8 @@ class ProjectLogic extends BaseLogic
131 * @time :2023/8/30 11:57 131 * @time :2023/8/30 11:57
132 */ 132 */
133 public function projectSave(){ 133 public function projectSave(){
134 - DB::beginTransaction();  
135 - try { 134 +// DB::beginTransaction();
  135 +// try {
136 $this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除 136 $this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除
137 if($this->param['type'] == Project::TYPE_SEVEN){ 137 if($this->param['type'] == Project::TYPE_SEVEN){
138 //错误单直接返回,单独处理 138 //错误单直接返回,单独处理
@@ -156,13 +156,14 @@ class ProjectLogic extends BaseLogic @@ -156,13 +156,14 @@ class ProjectLogic extends BaseLogic
156 $this->syncImageFile($this->param['project_location'],$this->param['id']); 156 $this->syncImageFile($this->param['project_location'],$this->param['id']);
157 //创建站点 157 //创建站点
158 // $this->createSite($this->param); 158 // $this->createSite($this->param);
159 - }  
160 - DB::commit();  
161 - }catch (\Exception $e){  
162 - DB::rollBack();  
163 - $this->fail('保存失败,请联系管理员');  
164 - }  
165 (new SyncService())->projectAcceptAddress($this->param['id']); 159 (new SyncService())->projectAcceptAddress($this->param['id']);
  160 + }
  161 +// DB::commit();
  162 +// }catch (\Exception $e){
  163 +// DB::rollBack();
  164 +// $this->fail('保存失败,请联系管理员');
  165 +// }
  166 +
166 return $this->success(); 167 return $this->success();
167 } 168 }
168 169