|
@@ -102,10 +102,9 @@ class ProjectServer |
|
@@ -102,10 +102,9 @@ class ProjectServer |
|
102
|
* @time :2023/9/19 14:45
|
102
|
* @time :2023/9/19 14:45
|
|
103
|
*/
|
103
|
*/
|
|
104
|
public static function saveInitParam($project_id){
|
104
|
public static function saveInitParam($project_id){
|
|
105
|
- $created_at = date('Y-m-d H:i:s');
|
|
|
|
106
|
- self::initGroup($project_id,$created_at);
|
105
|
+ self::initGroup($project_id);
|
|
107
|
//初始化单页
|
106
|
//初始化单页
|
|
108
|
- self::init404Page($project_id,$created_at);
|
107
|
+ self::init404Page($project_id);
|
|
109
|
//初始化模块数据
|
108
|
//初始化模块数据
|
|
110
|
self::initModule($project_id);
|
109
|
self::initModule($project_id);
|
|
111
|
DB::disconnect('custom_mysql');
|
110
|
DB::disconnect('custom_mysql');
|
|
@@ -140,16 +139,17 @@ class ProjectServer |
|
@@ -140,16 +139,17 @@ class ProjectServer |
|
140
|
* @method :post
|
139
|
* @method :post
|
|
141
|
* @time :2023/12/29 9:30
|
140
|
* @time :2023/12/29 9:30
|
|
142
|
*/
|
141
|
*/
|
|
143
|
- public static function initGroup($project_id,$created_at){
|
142
|
+ public static function initGroup($project_id){
|
|
|
|
143
|
+ $time = date('Y-m-d H:i:s');
|
|
144
|
$info = DB::connection('custom_mysql')->table('gl_web_nav')->first();
|
144
|
$info = DB::connection('custom_mysql')->table('gl_web_nav')->first();
|
|
145
|
if(empty($info)) {
|
145
|
if(empty($info)) {
|
|
146
|
$data = [
|
146
|
$data = [
|
|
147
|
- ['project_id' => $project_id, 'name' => 'Home', 'url' => 'Home', 'location' => 'header', 'group_id' => 1, 'created_at' => $created_at, 'updated_at' => $created_at],
|
|
|
|
148
|
- ['project_id' => $project_id, 'name' => 'Products', 'url' => 'Products', 'location' => 'header', 'group_id' => 1, 'created_at' => $created_at, 'updated_at' => $created_at],
|
|
|
|
149
|
- ['project_id' => $project_id, 'name' => 'News', 'url' => 'News', 'location' => 'header', 'group_id' => 1, 'created_at' => $created_at, 'updated_at' => $created_at],
|
|
|
|
150
|
- ['project_id' => $project_id, 'name' => 'ABOUT US', 'url' => 'about-us', 'location' => 'footer', 'group_id' => 2, 'created_at' => $created_at, 'updated_at' => $created_at],
|
|
|
|
151
|
- ['project_id' => $project_id, 'name' => 'Contact Us', 'url' => 'contact-us', 'location' => 'footer', 'group_id' => 2, 'created_at' => $created_at, 'updated_at' => $created_at],
|
|
|
|
152
|
- ['project_id' => $project_id, 'name' => 'FAQ', 'url' => 'faq', 'location' => 'footer', 'group_id' => 2, 'created_at' => $created_at, 'updated_at' => $created_at],
|
147
|
+ ['project_id' => $project_id, 'name' => 'Home', 'url' => 'Home', 'location' => 'header', 'group_id' => 1, 'created_at' => $time, 'updated_at' => $time],
|
|
|
|
148
|
+ ['project_id' => $project_id, 'name' => 'Products', 'url' => 'Products', 'location' => 'header', 'group_id' => 1, 'created_at' => $time, 'updated_at' => $time],
|
|
|
|
149
|
+ ['project_id' => $project_id, 'name' => 'News', 'url' => 'News', 'location' => 'header', 'group_id' => 1, 'created_at' => $time, 'updated_at' => $time],
|
|
|
|
150
|
+ ['project_id' => $project_id, 'name' => 'ABOUT US', 'url' => 'about-us', 'location' => 'footer', 'group_id' => 2, 'created_at' => $time, 'updated_at' => $time],
|
|
|
|
151
|
+ ['project_id' => $project_id, 'name' => 'Contact Us', 'url' => 'contact-us', 'location' => 'footer', 'group_id' => 2, 'created_at' => $time, 'updated_at' => $time],
|
|
|
|
152
|
+ ['project_id' => $project_id, 'name' => 'FAQ', 'url' => 'faq', 'location' => 'footer', 'group_id' => 2, 'created_at' => $time, 'updated_at' => $time],
|
|
153
|
];
|
153
|
];
|
|
154
|
DB::connection('custom_mysql')->table('gl_web_nav')->insert($data);
|
154
|
DB::connection('custom_mysql')->table('gl_web_nav')->insert($data);
|
|
155
|
}
|
155
|
}
|
|
@@ -157,8 +157,8 @@ class ProjectServer |
|
@@ -157,8 +157,8 @@ class ProjectServer |
|
157
|
$info = DB::connection('custom_mysql')->table('gl_web_nav_group')->first();
|
157
|
$info = DB::connection('custom_mysql')->table('gl_web_nav_group')->first();
|
|
158
|
if(empty($info)) {
|
158
|
if(empty($info)) {
|
|
159
|
$data = [
|
159
|
$data = [
|
|
160
|
- ['id' => 1, 'project_id' => $project_id, 'name' => '全局顶部菜单', 'created_at' => $created_at, 'updated_at' => $created_at],
|
|
|
|
161
|
- ['id' => 2, 'project_id' => $project_id, 'name' => '底部菜单', 'created_at' => $created_at, 'updated_at' => $created_at],
|
160
|
+ ['id' => 1, 'project_id' => $project_id, 'name' => '全局顶部菜单', 'created_at' => $time, 'updated_at' => $time],
|
|
|
|
161
|
+ ['id' => 2, 'project_id' => $project_id, 'name' => '底部菜单', 'created_at' => $time, 'updated_at' => $time],
|
|
162
|
];
|
162
|
];
|
|
163
|
DB::connection('custom_mysql')->table('gl_web_nav_group')->insert($data);
|
163
|
DB::connection('custom_mysql')->table('gl_web_nav_group')->insert($data);
|
|
164
|
}
|
164
|
}
|
|
@@ -172,7 +172,8 @@ class ProjectServer |
|
@@ -172,7 +172,8 @@ class ProjectServer |
|
172
|
* @method :post
|
172
|
* @method :post
|
|
173
|
* @time :2023/12/29 9:32
|
173
|
* @time :2023/12/29 9:32
|
|
174
|
*/
|
174
|
*/
|
|
175
|
- public function init404Page($project_id,$created_at){
|
175
|
+ public function init404Page($project_id){
|
|
|
|
176
|
+ $time = date('Y-m-d H:i:s');
|
|
176
|
$info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first();
|
177
|
$info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first();
|
|
177
|
if(empty($info)) {
|
178
|
if(empty($info)) {
|
|
178
|
$main_404_html = '<main>
|
179
|
$main_404_html = '<main>
|
|
@@ -211,12 +212,12 @@ class ProjectServer |
|
@@ -211,12 +212,12 @@ class ProjectServer |
|
211
|
'html_style' => '<style id="globalsojs-styles"></style>',
|
212
|
'html_style' => '<style id="globalsojs-styles"></style>',
|
|
212
|
'title' => '404-Page not found',
|
213
|
'title' => '404-Page not found',
|
|
213
|
'description' => 'Sorry. The page has either moved or cannot be found.',
|
214
|
'description' => 'Sorry. The page has either moved or cannot be found.',
|
|
214
|
- 'created_at' => $created_at, 'updated_at' => $created_at];
|
215
|
+ 'created_at' => $time, 'updated_at' => $time];
|
|
215
|
$id = DB::connection('custom_mysql')->table('gl_web_custom_template')->insertGetId($data);
|
216
|
$id = DB::connection('custom_mysql')->table('gl_web_custom_template')->insertGetId($data);
|
|
216
|
//路由
|
217
|
//路由
|
|
217
|
$info = DB::connection('custom_mysql')->table('gl_route_map')->first();
|
218
|
$info = DB::connection('custom_mysql')->table('gl_route_map')->first();
|
|
218
|
if(empty($info)) {
|
219
|
if(empty($info)) {
|
|
219
|
- $data = ['project_id' => $project_id, 'source' => RouteMap::SOURCE_PAGE, 'source_id' => $id, 'route' => BCustomTemplate::NOT_FOUND_PAGE_URL, 'created_at' => $created_at, 'updated_at' => $created_at];
|
220
|
+ $data = ['project_id' => $project_id, 'source' => RouteMap::SOURCE_PAGE, 'source_id' => $id, 'route' => BCustomTemplate::NOT_FOUND_PAGE_URL, 'created_at' => $time, 'updated_at' => $time];
|
|
220
|
DB::connection('custom_mysql')->table('gl_route_map')->insert($data);
|
221
|
DB::connection('custom_mysql')->table('gl_route_map')->insert($data);
|
|
221
|
}
|
222
|
}
|
|
222
|
}
|
223
|
}
|