作者 赵彬吉

update

@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 namespace App\Services; 9 namespace App\Services;
10 10
11 use App\Models\Project\Project; 11 use App\Models\Project\Project;
  12 +use App\Models\RouteMap\RouteMap;
12 use Illuminate\Support\Facades\DB; 13 use Illuminate\Support\Facades\DB;
13 use Illuminate\Support\Facades\Schema; 14 use Illuminate\Support\Facades\Schema;
14 15
@@ -128,8 +129,7 @@ class ProjectServer extends BaseService @@ -128,8 +129,7 @@ class ProjectServer extends BaseService
128 //初始化单页 129 //初始化单页
129 $info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first(); 130 $info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first();
130 if(empty($info)) { 131 if(empty($info)) {
131 - $data = [  
132 - ['project_id' => $project_id, 'name' => '404', 'status' => 1, 'url' => '404', 'html' => '<main> 132 + $data = ['project_id' => $project_id, 'name' => '404', 'status' => 1, 'url' => '404', 'html' => '<main>
133 <section data-section="section" data-screen="screen-large" class="section-404-wrap-block section-block-error404" 133 <section data-section="section" data-screen="screen-large" class="section-404-wrap-block section-block-error404"
134 id="sectionIdyxqu938"> 134 id="sectionIdyxqu938">
135 <div class="layout" data-unable="demo01-error404"> 135 <div class="layout" data-unable="demo01-error404">
@@ -154,9 +154,14 @@ class ProjectServer extends BaseService @@ -154,9 +154,14 @@ class ProjectServer extends BaseService
154 <script> 154 <script>
155 </script> 155 </script>
156 </section> 156 </section>
157 - </main>', 'html_style' => '<style id="globalsojs-styles"></style>'],  
158 - ];  
159 - DB::connection('custom_mysql')->table('gl_web_custom_template')->insert($data); 157 + </main>', 'html_style' => '<style id="globalsojs-styles"></style>','created_at' => $created_at, 'updated_at' => $created_at];
  158 + $id = DB::connection('custom_mysql')->table('gl_web_custom_template')->insertGetId($data);
  159 + //路由
  160 + $info = DB::connection('custom_mysql')->table('gl_route_map')->first();
  161 + if(empty($info)) {
  162 + $data = ['project_id' => $project_id, 'source' => RouteMap::SOURCE_PAGE, 'source_id' => $id, 'route' => '404', 'created_at' => $created_at, 'updated_at' => $created_at];
  163 + DB::connection('custom_mysql')->table('gl_route_map')->insert($data);
  164 + }
160 } 165 }
161 166
162 DB::disconnect('custom_mysql'); 167 DB::disconnect('custom_mysql');