正在显示
5 个修改的文件
包含
112 行增加
和
67 行删除
| @@ -82,17 +82,6 @@ class InitProject extends Command | @@ -82,17 +82,6 @@ class InitProject extends Command | ||
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | /** | 84 | /** |
| 85 | - * @remark :保存默认扩展模块 | ||
| 86 | - * @name :saveModule | ||
| 87 | - * @author :lyh | ||
| 88 | - * @method :post | ||
| 89 | - * @time :2023/12/28 15:53 | ||
| 90 | - */ | ||
| 91 | - public function saveModule(){ | ||
| 92 | - | ||
| 93 | - } | ||
| 94 | - | ||
| 95 | - /** | ||
| 96 | * @param NoticeLog $log | 85 | * @param NoticeLog $log |
| 97 | */ | 86 | */ |
| 98 | public function retry($log, $remark){ | 87 | public function retry($log, $remark){ |
| @@ -73,7 +73,7 @@ class BTemplateLogic extends BaseLogic | @@ -73,7 +73,7 @@ class BTemplateLogic extends BaseLogic | ||
| 73 | 'is_custom'=>$is_custom, 'is_list'=>$is_list | 73 | 'is_custom'=>$is_custom, 'is_list'=>$is_list |
| 74 | ]); | 74 | ]); |
| 75 | if($templateInfo === false){ | 75 | if($templateInfo === false){ |
| 76 | - if($this->user['is_customized'] == BTemplate::SOURCE_VISUALIZATION){//处理定制页面初始数据 | 76 | + if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION){//处理定制页面初始数据 |
| 77 | $html = $this->isCustomizedPage($this->param['source'],$is_list);//获取定制页面的html | 77 | $html = $this->isCustomizedPage($this->param['source'],$is_list);//获取定制页面的html |
| 78 | return $this->success(['html'=>$html,'template_id'=>$template_id]); | 78 | return $this->success(['html'=>$html,'template_id'=>$template_id]); |
| 79 | } | 79 | } |
| @@ -128,8 +128,8 @@ class BTemplateLogic extends BaseLogic | @@ -128,8 +128,8 @@ class BTemplateLogic extends BaseLogic | ||
| 128 | * @time :2023/7/27 15:08 | 128 | * @time :2023/7/27 15:08 |
| 129 | */ | 129 | */ |
| 130 | public function getInitModule($type,$is_custom,$is_list){ | 130 | public function getInitModule($type,$is_custom,$is_list){ |
| 131 | - if($is_custom == BTemplate::SOURCE_CUSTOM) { | ||
| 132 | - $type = BTemplate::TYPE_CUSTOM; | 131 | + if($is_custom == BTemplate::IS_CUSTOM) { |
| 132 | + $type = BTemplate::SOURCE_CUSTOM; | ||
| 133 | } | 133 | } |
| 134 | $mainModel = new TemplateTypeMain(); | 134 | $mainModel = new TemplateTypeMain(); |
| 135 | $info = $mainModel->read(['type'=>$type,'is_list'=>$is_list]); | 135 | $info = $mainModel->read(['type'=>$type,'is_list'=>$is_list]); |
| @@ -189,26 +189,26 @@ class BTemplateLogic extends BaseLogic | @@ -189,26 +189,26 @@ class BTemplateLogic extends BaseLogic | ||
| 189 | * @time :2023/11/16 11:20 | 189 | * @time :2023/11/16 11:20 |
| 190 | */ | 190 | */ |
| 191 | public function getCustomizedType($source,$is_list){ | 191 | public function getCustomizedType($source,$is_list){ |
| 192 | - $type = BTemplate::TYPE_ONE; | 192 | + $type = BTemplate::TYPE_HOME; |
| 193 | if($source == BTemplate::SOURCE_PRODUCT){ | 193 | if($source == BTemplate::SOURCE_PRODUCT){ |
| 194 | if($is_list == BTemplate::IS_LIST){ | 194 | if($is_list == BTemplate::IS_LIST){ |
| 195 | - $type = BTemplate::TYPE_THREE; | 195 | + $type = BTemplate::TYPE_PRODUCT_LIST; |
| 196 | }else{ | 196 | }else{ |
| 197 | - $type = BTemplate::TYPE_TWO; | 197 | + $type = BTemplate::TYPE_PRODUCT_DETAIL; |
| 198 | } | 198 | } |
| 199 | } | 199 | } |
| 200 | if($source == BTemplate::SOURCE_BLOG){ | 200 | if($source == BTemplate::SOURCE_BLOG){ |
| 201 | if($is_list == BTemplate::IS_LIST){ | 201 | if($is_list == BTemplate::IS_LIST){ |
| 202 | - $type = BTemplate::TYPE_FIVE; | 202 | + $type = BTemplate::TYPE_BLOG_LIST; |
| 203 | }else{ | 203 | }else{ |
| 204 | - $type = BTemplate::TYPE_FOUR; | 204 | + $type = BTemplate::TYPE_BLOG_DETAIL; |
| 205 | } | 205 | } |
| 206 | } | 206 | } |
| 207 | if($source == BTemplate::SOURCE_NEWS){ | 207 | if($source == BTemplate::SOURCE_NEWS){ |
| 208 | if($is_list == BTemplate::IS_LIST){ | 208 | if($is_list == BTemplate::IS_LIST){ |
| 209 | - $type = BTemplate::TYPE_SEVEN; | 209 | + $type = BTemplate::TYPE_NEWS_LIST; |
| 210 | }else{ | 210 | }else{ |
| 211 | - $type = BTemplate::TYPE_SIX; | 211 | + $type = BTemplate::TYPE_NEWS_DETAIL; |
| 212 | } | 212 | } |
| 213 | } | 213 | } |
| 214 | return $type; | 214 | return $type; |
| @@ -223,7 +223,7 @@ class BTemplateLogic extends BaseLogic | @@ -223,7 +223,7 @@ class BTemplateLogic extends BaseLogic | ||
| 223 | */ | 223 | */ |
| 224 | public function getSettingTemplate($source,$is_list){ | 224 | public function getSettingTemplate($source,$is_list){ |
| 225 | $template_id = 0; | 225 | $template_id = 0; |
| 226 | - if($this->user['is_customized'] == BTemplate::SOURCE_VISUALIZATION) {//定制项目 | 226 | + if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION) {//定制项目 |
| 227 | $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型 | 227 | $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型 |
| 228 | //查看当前页面是否定制,是否开启可视化 | 228 | //查看当前页面是否定制,是否开启可视化 |
| 229 | $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面 | 229 | $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面 |
| @@ -336,7 +336,7 @@ class BTemplateLogic extends BaseLogic | @@ -336,7 +336,7 @@ class BTemplateLogic extends BaseLogic | ||
| 336 | * @time :2023/12/15 10:59 | 336 | * @time :2023/12/15 10:59 |
| 337 | */ | 337 | */ |
| 338 | public function handleVisualizationParam($html,$source, $is_list,$data){ | 338 | public function handleVisualizationParam($html,$source, $is_list,$data){ |
| 339 | - if($this->user['is_customized'] == BTemplate::SOURCE_VISUALIZATION){//定制项目 | 339 | + if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION){//定制项目 |
| 340 | $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型 | 340 | $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型 |
| 341 | //查看当前页面是否定制,是否开启可视化 | 341 | //查看当前页面是否定制,是否开启可视化 |
| 342 | $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面 | 342 | $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面 |
| @@ -453,13 +453,13 @@ class BTemplateLogic extends BaseLogic | @@ -453,13 +453,13 @@ class BTemplateLogic extends BaseLogic | ||
| 453 | if ($pageInfo === false) { | 453 | if ($pageInfo === false) { |
| 454 | return $this->success($type); | 454 | return $this->success($type); |
| 455 | } | 455 | } |
| 456 | - if ($source == BTemplate::SOURCE_PRODUCT) {if ($is_list == 0) {if ($pageInfo['product_details'] != 0) {$type = BTemplate::TYPE_TWO;}} | ||
| 457 | - else {if ($pageInfo['product_list'] != 0) {$type = BTemplate::TYPE_THREE;}}} | ||
| 458 | - if ($source == BTemplate::SOURCE_BLOG) {if ($is_list == 0) {if ($pageInfo['blog_details'] != 0) {$type = BTemplate::TYPE_FOUR;}} | ||
| 459 | - else {if ($pageInfo['blog_list'] != 0) {$type = BTemplate::TYPE_FIVE;}}} | ||
| 460 | - if ($source == BTemplate::SOURCE_NEWS) {if ($is_list == 0) {if ($pageInfo['news_details'] != 0) {$type = BTemplate::TYPE_SIX;}} | ||
| 461 | - else {if ($pageInfo['news_list'] != 0) {$type = BTemplate::TYPE_SEVEN;}}} | ||
| 462 | - if ($source == BTemplate::SOURCE_KEYWORD) {if ($pageInfo['polymerization'] != 0) {$type = BTemplate::TYPE_EIGHT;}} | 456 | + if ($source == BTemplate::SOURCE_PRODUCT) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['product_details'] != 0) {$type = BTemplate::TYPE_PRODUCT_DETAIL;}} |
| 457 | + else {if ($pageInfo['product_list'] != 0) {$type = BTemplate::TYPE_PRODUCT_LIST;}}} | ||
| 458 | + if ($source == BTemplate::SOURCE_BLOG) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['blog_details'] != 0) {$type = BTemplate::TYPE_BLOG_DETAIL;}} | ||
| 459 | + else {if ($pageInfo['blog_list'] != 0) {$type = BTemplate::TYPE_BLOG_LIST;}}} | ||
| 460 | + if ($source == BTemplate::SOURCE_NEWS) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['news_details'] != 0) {$type = BTemplate::TYPE_NEWS_DETAIL;}} | ||
| 461 | + else {if ($pageInfo['news_list'] != 0) {$type = BTemplate::TYPE_NEWS_LIST;}}} | ||
| 462 | + if ($source == BTemplate::SOURCE_KEYWORD) {if ($pageInfo['polymerization'] != 0) {$type = BTemplate::TYPE_CUSTOM_PAGE;}} | ||
| 463 | } | 463 | } |
| 464 | return $this->success($type); | 464 | return $this->success($type); |
| 465 | } | 465 | } |
| @@ -581,7 +581,7 @@ class BTemplateLogic extends BaseLogic | @@ -581,7 +581,7 @@ class BTemplateLogic extends BaseLogic | ||
| 581 | $param['main_css'] = characterTruncation($param['html'],'/<style id="globalsojs-styles">(.*?)<\/style>/s'); | 581 | $param['main_css'] = characterTruncation($param['html'],'/<style id="globalsojs-styles">(.*?)<\/style>/s'); |
| 582 | $param['footer_css'] = characterTruncation($param['html'],'/<style id="globalsojs-footer">(.*?)<\/style>/s'); | 582 | $param['footer_css'] = characterTruncation($param['html'],'/<style id="globalsojs-footer">(.*?)<\/style>/s'); |
| 583 | if(!isset($param['is_custom'])){ | 583 | if(!isset($param['is_custom'])){ |
| 584 | - $param['is_custom'] = BTemplate::SOURCE_NO_CUSTOM; | 584 | + $param['is_custom'] = BTemplate::IS_NO_CUSTOM; |
| 585 | } | 585 | } |
| 586 | $param['type'] = BTemplate::PAGE_HTML;//不显示整个HTML | 586 | $param['type'] = BTemplate::PAGE_HTML;//不显示整个HTML |
| 587 | return $this->success($param); | 587 | return $this->success($param); |
| @@ -126,7 +126,7 @@ class InitHtmlLogic extends BaseLogic | @@ -126,7 +126,7 @@ class InitHtmlLogic extends BaseLogic | ||
| 126 | $templateCommonModel = new BTemplateCommon(); | 126 | $templateCommonModel = new BTemplateCommon(); |
| 127 | //查看当前模板是否有独立头部,有独立头部,更新独立头部,无独立头部,更新公共头部 | 127 | //查看当前模板是否有独立头部,有独立头部,更新独立头部,无独立头部,更新公共头部 |
| 128 | $is_head = $this->user['configuration']['is_head'] ?? 0; | 128 | $is_head = $this->user['configuration']['is_head'] ?? 0; |
| 129 | - if($is_custom == BTemplate::SOURCE_CUSTOM){//todo::扩展模块无独立头部底部 | 129 | + if($is_custom == BTemplate::IS_CUSTOM){//todo::扩展模块无独立头部底部 |
| 130 | $is_head = BTemplate::IS_NO_HEADER; | 130 | $is_head = BTemplate::IS_NO_HEADER; |
| 131 | } | 131 | } |
| 132 | if($is_head == BTemplate::IS_HEADER) { | 132 | if($is_head == BTemplate::IS_HEADER) { |
| @@ -174,8 +174,8 @@ class InitHtmlLogic extends BaseLogic | @@ -174,8 +174,8 @@ class InitHtmlLogic extends BaseLogic | ||
| 174 | * @time :2023/7/27 15:08 | 174 | * @time :2023/7/27 15:08 |
| 175 | */ | 175 | */ |
| 176 | public function getInitModule($type,$is_custom,$is_list){ | 176 | public function getInitModule($type,$is_custom,$is_list){ |
| 177 | - if($is_custom == BTemplate::SOURCE_CUSTOM) { | ||
| 178 | - $type = BTemplate::TYPE_CUSTOM; | 177 | + if($is_custom == BTemplate::IS_CUSTOM) { |
| 178 | + $type = BTemplate::SOURCE_CUSTOM; | ||
| 179 | } | 179 | } |
| 180 | $mainModel = new TemplateTypeMain(); | 180 | $mainModel = new TemplateTypeMain(); |
| 181 | $info = $mainModel->read(['type'=>$type,'is_list'=>$is_list]); | 181 | $info = $mainModel->read(['type'=>$type,'is_list'=>$is_list]); |
| @@ -192,7 +192,7 @@ class InitHtmlLogic extends BaseLogic | @@ -192,7 +192,7 @@ class InitHtmlLogic extends BaseLogic | ||
| 192 | public function getTypeCommonHtml($template_id,$type,$is_custom,$is_list){ | 192 | public function getTypeCommonHtml($template_id,$type,$is_custom,$is_list){ |
| 193 | //判断当前项目是否有设置独立头部的权限 | 193 | //判断当前项目是否有设置独立头部的权限 |
| 194 | $is_head = $this->user['configuration']['is_head'] ?? 0; | 194 | $is_head = $this->user['configuration']['is_head'] ?? 0; |
| 195 | - if($is_custom == BTemplate::SOURCE_CUSTOM){//todo::拓展模块默认取首页 | 195 | + if($is_custom == BTemplate::IS_CUSTOM){//todo::拓展模块默认取首页 |
| 196 | $is_head = BTemplate::IS_NO_HEADER; | 196 | $is_head = BTemplate::IS_NO_HEADER; |
| 197 | } | 197 | } |
| 198 | //获取首页公共部分 | 198 | //获取首页公共部分 |
| @@ -221,23 +221,23 @@ class InitHtmlLogic extends BaseLogic | @@ -221,23 +221,23 @@ class InitHtmlLogic extends BaseLogic | ||
| 221 | $resultType = BTemplate::SOURCE_HOME; | 221 | $resultType = BTemplate::SOURCE_HOME; |
| 222 | if($type == BTemplate::SOURCE_PRODUCT){ | 222 | if($type == BTemplate::SOURCE_PRODUCT){ |
| 223 | if($is_list == BTemplate::IS_LIST){ | 223 | if($is_list == BTemplate::IS_LIST){ |
| 224 | - $resultType = BTemplate::TYPE_THREE; | 224 | + $resultType = BTemplate::TYPE_PRODUCT_LIST; |
| 225 | }else{ | 225 | }else{ |
| 226 | - $resultType = BTemplate::TYPE_TWO; | 226 | + $resultType = BTemplate::TYPE_PRODUCT_DETAIL; |
| 227 | } | 227 | } |
| 228 | } | 228 | } |
| 229 | if($type == BTemplate::SOURCE_BLOG){ | 229 | if($type == BTemplate::SOURCE_BLOG){ |
| 230 | if($is_list == BTemplate::IS_LIST){ | 230 | if($is_list == BTemplate::IS_LIST){ |
| 231 | - $resultType = BTemplate::TYPE_FIVE; | 231 | + $resultType = BTemplate::TYPE_BLOG_LIST; |
| 232 | }else{ | 232 | }else{ |
| 233 | - $resultType = BTemplate::TYPE_FOUR; | 233 | + $resultType = BTemplate::TYPE_BLOG_DETAIL; |
| 234 | } | 234 | } |
| 235 | } | 235 | } |
| 236 | if($type == BTemplate::SOURCE_NEWS){ | 236 | if($type == BTemplate::SOURCE_NEWS){ |
| 237 | if($is_list == BTemplate::IS_LIST){ | 237 | if($is_list == BTemplate::IS_LIST){ |
| 238 | - $resultType = BTemplate::TYPE_SEVEN; | 238 | + $resultType = BTemplate::TYPE_NEWS_LIST; |
| 239 | }else{ | 239 | }else{ |
| 240 | - $resultType = BTemplate::TYPE_SIX; | 240 | + $resultType = BTemplate::TYPE_NEWS_DETAIL; |
| 241 | } | 241 | } |
| 242 | } | 242 | } |
| 243 | return $this->success($resultType); | 243 | return $this->success($resultType); |
| @@ -12,34 +12,31 @@ use App\Models\Base; | @@ -12,34 +12,31 @@ use App\Models\Base; | ||
| 12 | */ | 12 | */ |
| 13 | class BTemplate extends Base | 13 | class BTemplate extends Base |
| 14 | { | 14 | { |
| 15 | - const SOURCE_CUSTOM = 1;//自定义模块 | ||
| 16 | const SOURCE_HOME = 1;//首页 | 15 | const SOURCE_HOME = 1;//首页 |
| 17 | const SOURCE_PRODUCT = 2;//产品 | 16 | const SOURCE_PRODUCT = 2;//产品 |
| 17 | + | ||
| 18 | const SOURCE_BLOG = 3;//博客 | 18 | const SOURCE_BLOG = 3;//博客 |
| 19 | + | ||
| 19 | const SOURCE_NEWS = 4;//新闻详情页 | 20 | const SOURCE_NEWS = 4;//新闻详情页 |
| 20 | const SOURCE_KEYWORD = 5;//聚合页 | 21 | const SOURCE_KEYWORD = 5;//聚合页 |
| 21 | - | 22 | + const SOURCE_CUSTOM = 7;//自定义模块 |
| 22 | const ALL_HTML = 1;//无需拼接数据,获取整个html | 23 | const ALL_HTML = 1;//无需拼接数据,获取整个html |
| 23 | - | ||
| 24 | const PAGE_HTML = 0;//默认保存方式为0, | 24 | const PAGE_HTML = 0;//默认保存方式为0, |
| 25 | - const SOURCE_VISUALIZATION = 1;//定制项目 | ||
| 26 | - | ||
| 27 | - const SOURCE_NO_CUSTOM = 0;//默认模块 | ||
| 28 | const STATUS = 0; | 25 | const STATUS = 0; |
| 29 | - | ||
| 30 | - const TYPE_ONE = 1;//首页类型 | ||
| 31 | - const TYPE_TWO = 2;//产品详情 | ||
| 32 | - const TYPE_THREE = 3;//产品列表 | ||
| 33 | - const TYPE_FOUR = 4;//博客详情 | ||
| 34 | - const TYPE_FIVE = 5;//博客列表 | ||
| 35 | - const TYPE_SIX = 6;//新闻详情 | ||
| 36 | - const TYPE_SEVEN = 7;//新闻列表 | ||
| 37 | - const TYPE_EIGHT = 8;//自定义页面 | ||
| 38 | - | ||
| 39 | - const TYPE_CUSTOM = 7;//扩展详情 | 26 | + const TYPE_HOME = 1;//首页类型 |
| 27 | + const TYPE_PRODUCT_DETAIL = 2;//产品详情 | ||
| 28 | + const TYPE_PRODUCT_LIST = 3;//产品列表 | ||
| 29 | + const TYPE_BLOG_DETAIL = 4;//博客详情 | ||
| 30 | + const TYPE_BLOG_LIST = 5;//博客列表 | ||
| 31 | + const TYPE_NEWS_DETAIL = 6;//新闻详情 | ||
| 32 | + const TYPE_NEWS_LIST = 7;//新闻列表 | ||
| 33 | + const TYPE_CUSTOM_PAGE = 8;//自定义页面 | ||
| 40 | const IS_LIST = 1;//列表页 | 34 | const IS_LIST = 1;//列表页 |
| 41 | const IS_HEADER = 1;//独立头部底部 | 35 | const IS_HEADER = 1;//独立头部底部 |
| 42 | const IS_NO_HEADER = 0;//非独立头部底部 | 36 | const IS_NO_HEADER = 0;//非独立头部底部 |
| 37 | + const IS_CUSTOM = 1;//为扩展模块 | ||
| 38 | + const IS_NO_CUSTOM = 0;//为默认模块 | ||
| 39 | + const IS_VISUALIZATION = 1;//定制项目 | ||
| 43 | 40 | ||
| 44 | protected $table = 'gl_web_template'; | 41 | protected $table = 'gl_web_template'; |
| 45 | //连接数据库 | 42 | //连接数据库 |
| @@ -110,10 +107,21 @@ class BTemplate extends Base | @@ -110,10 +107,21 @@ class BTemplate extends Base | ||
| 110 | ] | 107 | ] |
| 111 | ]; | 108 | ]; |
| 112 | 109 | ||
| 110 | + /** | ||
| 111 | + * @remark :对用模块类型 | ||
| 112 | + * @name :typeMap | ||
| 113 | + * @author :lyh | ||
| 114 | + * @method :post | ||
| 115 | + * @time :2023/12/29 10:57 | ||
| 116 | + */ | ||
| 113 | public function typeMap() | 117 | public function typeMap() |
| 114 | { | 118 | { |
| 115 | return [ | 119 | return [ |
| 116 | - self::SOURCE_HOME => 'xxxx', | 120 | + 'SOURCE_HOME'=>self::SOURCE_HOME, |
| 121 | + 'SOURCE_PRODUCT'=>self::SOURCE_PRODUCT, | ||
| 122 | + 'SOURCE_BLOG'=>self::SOURCE_BLOG, | ||
| 123 | + 'SOURCE_NEWS'=>self::SOURCE_NEWS, | ||
| 124 | + 'SOURCE_KEYWORD'=>self::SOURCE_KEYWORD, | ||
| 117 | ]; | 125 | ]; |
| 118 | } | 126 | } |
| 119 | } | 127 | } |
| @@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
| 8 | 8 | ||
| 9 | namespace App\Services; | 9 | namespace App\Services; |
| 10 | 10 | ||
| 11 | +use App\Models\CustomModule\CustomModule; | ||
| 11 | use App\Models\Project\Project; | 12 | use App\Models\Project\Project; |
| 12 | use App\Models\RouteMap\RouteMap; | 13 | use App\Models\RouteMap\RouteMap; |
| 13 | use App\Models\Template\BCustomTemplate; | 14 | use App\Models\Template\BCustomTemplate; |
| @@ -102,8 +103,43 @@ class ProjectServer extends BaseService | @@ -102,8 +103,43 @@ class ProjectServer extends BaseService | ||
| 102 | */ | 103 | */ |
| 103 | public static function saveInitParam($project_id){ | 104 | public static function saveInitParam($project_id){ |
| 104 | $created_at = date('Y-m-d H:i:s'); | 105 | $created_at = date('Y-m-d H:i:s'); |
| 106 | + self::initGroup($project_id,$created_at); | ||
| 107 | + //初始化单页 | ||
| 108 | + self::init404Page($project_id); | ||
| 109 | + //初始化模块数据 | ||
| 110 | + self::initModule($project_id); | ||
| 111 | + DB::disconnect('custom_mysql'); | ||
| 112 | + return true; | ||
| 113 | + } | ||
| 105 | 114 | ||
| 106 | - //菜单 | 115 | + /** |
| 116 | + * @remark :初始化模块 | ||
| 117 | + * @name :initModule | ||
| 118 | + * @author :lyh | ||
| 119 | + * @method :post | ||
| 120 | + * @time :2023/12/29 9:34 | ||
| 121 | + */ | ||
| 122 | + public function initModule($project_id){ | ||
| 123 | + $moduleModel = new CustomModule(); | ||
| 124 | + $info = $moduleModel->read(['route'=>'video']); | ||
| 125 | + if($info === false){ | ||
| 126 | + $data = [ | ||
| 127 | + 'name'=>'视频模块', | ||
| 128 | + 'project_id'=>$project_id, | ||
| 129 | + 'route'=>'video', | ||
| 130 | + ]; | ||
| 131 | + $moduleModel->add($data); | ||
| 132 | + } | ||
| 133 | + return true; | ||
| 134 | + } | ||
| 135 | + /** | ||
| 136 | + * @remark :菜单 | ||
| 137 | + * @name :initGroup | ||
| 138 | + * @author :lyh | ||
| 139 | + * @method :post | ||
| 140 | + * @time :2023/12/29 9:30 | ||
| 141 | + */ | ||
| 142 | + public static function initGroup($project_id,$created_at){ | ||
| 107 | $info = DB::connection('custom_mysql')->table('gl_web_nav')->first(); | 143 | $info = DB::connection('custom_mysql')->table('gl_web_nav')->first(); |
| 108 | if(empty($info)) { | 144 | if(empty($info)) { |
| 109 | $data = [ | 145 | $data = [ |
| @@ -116,7 +152,6 @@ class ProjectServer extends BaseService | @@ -116,7 +152,6 @@ class ProjectServer extends BaseService | ||
| 116 | ]; | 152 | ]; |
| 117 | DB::connection('custom_mysql')->table('gl_web_nav')->insert($data); | 153 | DB::connection('custom_mysql')->table('gl_web_nav')->insert($data); |
| 118 | } | 154 | } |
| 119 | - | ||
| 120 | //菜单组 | 155 | //菜单组 |
| 121 | $info = DB::connection('custom_mysql')->table('gl_web_nav_group')->first(); | 156 | $info = DB::connection('custom_mysql')->table('gl_web_nav_group')->first(); |
| 122 | if(empty($info)) { | 157 | if(empty($info)) { |
| @@ -126,11 +161,20 @@ class ProjectServer extends BaseService | @@ -126,11 +161,20 @@ class ProjectServer extends BaseService | ||
| 126 | ]; | 161 | ]; |
| 127 | DB::connection('custom_mysql')->table('gl_web_nav_group')->insert($data); | 162 | DB::connection('custom_mysql')->table('gl_web_nav_group')->insert($data); |
| 128 | } | 163 | } |
| 164 | + return true; | ||
| 165 | + } | ||
| 129 | 166 | ||
| 130 | - //初始化单页 | 167 | + /** |
| 168 | + * @remark :初始化404页面 | ||
| 169 | + * @name :init404Page | ||
| 170 | + * @author :lyh | ||
| 171 | + * @method :post | ||
| 172 | + * @time :2023/12/29 9:32 | ||
| 173 | + */ | ||
| 174 | + public function init404Page($project_id){ | ||
| 131 | $info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first(); | 175 | $info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first(); |
| 132 | if(empty($info)) { | 176 | if(empty($info)) { |
| 133 | - $data = ['project_id' => $project_id, 'name' => BCustomTemplate::NOT_FOUND_PAGE_URL, 'status' => 1, 'url' => BCustomTemplate::NOT_FOUND_PAGE_URL, 'html' => '<main> | 177 | + $main_404_html = '<main> |
| 134 | <section data-section="section" data-screen="screen-large" class="section-404-wrap-block section-block-error404" | 178 | <section data-section="section" data-screen="screen-large" class="section-404-wrap-block section-block-error404" |
| 135 | id="sectionIdyxqu938"> | 179 | id="sectionIdyxqu938"> |
| 136 | <div class="layout" data-unable="demo01-error404"> | 180 | <div class="layout" data-unable="demo01-error404"> |
| @@ -156,7 +200,14 @@ class ProjectServer extends BaseService | @@ -156,7 +200,14 @@ class ProjectServer extends BaseService | ||
| 156 | <script> | 200 | <script> |
| 157 | </script> | 201 | </script> |
| 158 | </section> | 202 | </section> |
| 159 | - </main>', 'html_style' => '<style id="globalsojs-styles"></style>','title' => '404-Page not found', 'description' => 'Sorry. The page has either moved or cannot be found.', 'created_at' => $created_at, 'updated_at' => $created_at]; | 203 | + </main>'; |
| 204 | + $data = [ | ||
| 205 | + 'project_id' => $project_id, | ||
| 206 | + 'name' => BCustomTemplate::NOT_FOUND_PAGE_URL, | ||
| 207 | + 'status' => 1, | ||
| 208 | + 'url' => BCustomTemplate::NOT_FOUND_PAGE_URL, | ||
| 209 | + 'html' => $main_404_html, | ||
| 210 | + 'html_style' => '<style id="globalsojs-styles"></style>','title' => '404-Page not found', 'description' => 'Sorry. The page has either moved or cannot be found.', 'created_at' => $created_at, 'updated_at' => $created_at]; | ||
| 160 | $id = DB::connection('custom_mysql')->table('gl_web_custom_template')->insertGetId($data); | 211 | $id = DB::connection('custom_mysql')->table('gl_web_custom_template')->insertGetId($data); |
| 161 | //路由 | 212 | //路由 |
| 162 | $info = DB::connection('custom_mysql')->table('gl_route_map')->first(); | 213 | $info = DB::connection('custom_mysql')->table('gl_route_map')->first(); |
| @@ -165,8 +216,5 @@ class ProjectServer extends BaseService | @@ -165,8 +216,5 @@ class ProjectServer extends BaseService | ||
| 165 | DB::connection('custom_mysql')->table('gl_route_map')->insert($data); | 216 | DB::connection('custom_mysql')->table('gl_route_map')->insert($data); |
| 166 | } | 217 | } |
| 167 | } | 218 | } |
| 168 | - | ||
| 169 | - DB::disconnect('custom_mysql'); | ||
| 170 | - return true; | ||
| 171 | } | 219 | } |
| 172 | } | 220 | } |
-
请 注册 或 登录 后发表评论