|
@@ -31,6 +31,7 @@ use App\Models\Project\MinorLanguages; |
|
@@ -31,6 +31,7 @@ use App\Models\Project\MinorLanguages; |
|
31
|
use App\Models\Project\Project;
|
31
|
use App\Models\Project\Project;
|
|
32
|
use App\Models\Purchaser\PurchaserInfo;
|
32
|
use App\Models\Purchaser\PurchaserInfo;
|
|
33
|
use App\Models\RouteMap\RouteMap;
|
33
|
use App\Models\RouteMap\RouteMap;
|
|
|
|
34
|
+use App\Models\Template\BCustomTemplate;
|
|
34
|
use App\Models\Template\BTemplateCom;
|
35
|
use App\Models\Template\BTemplateCom;
|
|
35
|
use App\Services\AmazonS3Service;
|
36
|
use App\Services\AmazonS3Service;
|
|
36
|
use App\Services\ProjectServer;
|
37
|
use App\Services\ProjectServer;
|
|
@@ -57,72 +58,66 @@ class Demo extends Command |
|
@@ -57,72 +58,66 @@ class Demo extends Command |
|
57
|
*/
|
58
|
*/
|
|
58
|
protected $description = 'demo';
|
59
|
protected $description = 'demo';
|
|
59
|
|
60
|
|
|
|
|
61
|
+ public static $main404Html = '<main>
|
|
|
|
62
|
+ <section data-section="section" data-screen="screen-large" class="section-404-wrap-block section-block-error404"
|
|
|
|
63
|
+ id="sectionIdyxqu938">
|
|
|
|
64
|
+ <div class="layout" data-unable="demo01-error404">
|
|
|
|
65
|
+ <img src="https://ecdn6.globalso.com/upload/m/image_other/2023-10/6528a87e594db30162.png" />
|
|
|
|
66
|
+ </div>
|
|
|
|
67
|
+ <p style="text-align: center">SORRY. THE PAGE HAS EITHER MOVED OR CANNOT BE FOUND.</p>
|
|
|
|
68
|
+ <style>
|
|
|
|
69
|
+ .section-block-error404 .layout {
|
|
|
|
70
|
+ height: 700px;
|
|
|
|
71
|
+ display: flex;
|
|
|
|
72
|
+ align-items: center;
|
|
|
|
73
|
+ justify-content: center;
|
|
|
|
74
|
+ }
|
|
|
|
75
|
+ .section-block-error404 img {
|
|
|
|
76
|
+ width: 400px;
|
|
|
|
77
|
+ }
|
|
|
|
78
|
+ @media only screen and (max-width:500) {
|
|
|
|
79
|
+ .section-block-error404 img {
|
|
|
|
80
|
+ max-width: 100%;
|
|
|
|
81
|
+ }
|
|
|
|
82
|
+ }
|
|
|
|
83
|
+ </style>
|
|
|
|
84
|
+ <script>
|
|
|
|
85
|
+ </script>
|
|
|
|
86
|
+ </section>
|
|
|
|
87
|
+ </main>';
|
|
60
|
public function handle(){
|
88
|
public function handle(){
|
|
61
|
- $optimizeModel = new DeployOptimize();
|
|
|
|
62
|
- $list = $optimizeModel->list();
|
|
|
|
63
|
- foreach ($list as $k => $v){
|
|
|
|
64
|
- if(!empty($v['g_top_plan'])){
|
|
|
|
65
|
- $v['g_top_plan']['is_compliance'] = 0;
|
|
|
|
66
|
- $optimizeModel->edit(['g_top_plan'=>json_encode($v['g_top_plan'])],['id'=>$v['id']]);
|
|
|
|
67
|
- echo date('Y-m-d H:i:s') . '重制g_top-project_id:'.$v['project_id'] . PHP_EOL;
|
89
|
+ $projectModel = new Project();
|
|
|
|
90
|
+ $list = $projectModel->list(['is_upgrade'=>1]);
|
|
|
|
91
|
+ $data = [];
|
|
|
|
92
|
+ foreach ($list as $v){
|
|
|
|
93
|
+ echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
|
|
|
|
94
|
+ ProjectServer::useProject($v['id']);
|
|
|
|
95
|
+ $this->init404Page($v['id']);
|
|
|
|
96
|
+ DB::disconnect('custom_mysql');
|
|
|
|
97
|
+ }
|
|
|
|
98
|
+ echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
|
|
|
|
99
|
+ }
|
|
|
|
100
|
+ public static function init404Page($project_id){
|
|
|
|
101
|
+ $time = date('Y-m-d H:i:s');
|
|
|
|
102
|
+ $info = DB::connection('custom_mysql')->table('gl_web_custom_template')->where('url',BCustomTemplate::NOT_FOUND_PAGE_URL)->first();
|
|
|
|
103
|
+ if(empty($info)) {
|
|
|
|
104
|
+ $data = [
|
|
|
|
105
|
+ 'project_id' => $project_id,
|
|
|
|
106
|
+ 'name' => BCustomTemplate::NOT_FOUND_PAGE_URL,
|
|
|
|
107
|
+ 'status' => 1,
|
|
|
|
108
|
+ 'url' => BCustomTemplate::NOT_FOUND_PAGE_URL,
|
|
|
|
109
|
+ 'html' => self::$main404Html,
|
|
|
|
110
|
+ 'html_style' => '<style id="globalsojs-styles"></style>',
|
|
|
|
111
|
+ 'title' => '404-Page not found',
|
|
|
|
112
|
+ 'description' => 'Sorry. The page has either moved or cannot be found.',
|
|
|
|
113
|
+ 'created_at' => $time, 'updated_at' => $time];
|
|
|
|
114
|
+ $id = DB::connection('custom_mysql')->table('gl_web_custom_template')->insertGetId($data);
|
|
|
|
115
|
+ //路由
|
|
|
|
116
|
+ $info = DB::connection('custom_mysql')->table('gl_route_map')->first();
|
|
|
|
117
|
+ if(empty($info)) {
|
|
|
|
118
|
+ $data = ['project_id' => $project_id, 'source' => RouteMap::SOURCE_PAGE, 'source_id' => $id, 'route' => BCustomTemplate::NOT_FOUND_PAGE_URL, 'created_at' => $time, 'updated_at' => $time];
|
|
|
|
119
|
+ DB::connection('custom_mysql')->table('gl_route_map')->insert($data);
|
|
68
|
}
|
120
|
}
|
|
69
|
}
|
121
|
}
|
|
70
|
- return true;
|
|
|
|
71
|
}
|
122
|
}
|
|
72
|
-
|
|
|
|
73
|
-// public function handle(){
|
|
|
|
74
|
-// $projectModel = new Project();
|
|
|
|
75
|
-// $list = $projectModel->list(['id'=>503]);
|
|
|
|
76
|
-// foreach ($list as $v){
|
|
|
|
77
|
-// echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
|
|
|
|
78
|
-// ProjectServer::useProject($v['id']);
|
|
|
|
79
|
-// $newsModel = new News();
|
|
|
|
80
|
-// $blogList = $newsModel->list(['status'=>1],'id',['*'],'asc');
|
|
|
|
81
|
-// foreach ($blogList as $blogV){
|
|
|
|
82
|
-// $customContentModel = new CustomModuleContent();
|
|
|
|
83
|
-// $id = $customContentModel->addReturnId([
|
|
|
|
84
|
-// 'name'=>$blogV['name'],
|
|
|
|
85
|
-// 'status'=>0,
|
|
|
|
86
|
-// 'sort'=>$blogV['sort'],
|
|
|
|
87
|
-// 'remark'=>$blogV['remark'],
|
|
|
|
88
|
-// 'route'=>$blogV['url'],
|
|
|
|
89
|
-// 'image'=>$blogV['image'],
|
|
|
|
90
|
-// 'seo_title'=>$blogV['seo_title'],
|
|
|
|
91
|
-// 'seo_keywords'=>$blogV['seo_keywords'],
|
|
|
|
92
|
-// 'seo_description'=>$blogV['seo_description'],
|
|
|
|
93
|
-// 'project_id'=>$blogV['project_id'],
|
|
|
|
94
|
-// 'created_at'=>$blogV['created_at'],
|
|
|
|
95
|
-// 'updated_at'=>$blogV['updated_at'],
|
|
|
|
96
|
-// 'module_id'=>10,
|
|
|
|
97
|
-// 'video'=>null,
|
|
|
|
98
|
-// 'release_at'=>$blogV['release_at'],
|
|
|
|
99
|
-// 'operator_id'=>$blogV['operator_id']
|
|
|
|
100
|
-// ]);
|
|
|
|
101
|
-// RouteMap::setRoute($blogV['url'],RouteMap::SOURCE_MODULE,$id,503);
|
|
|
|
102
|
-// }
|
|
|
|
103
|
-// DB::disconnect('custom_mysql');
|
|
|
|
104
|
-// }
|
|
|
|
105
|
-// }
|
|
|
|
106
|
-// public function handle(){
|
|
|
|
107
|
-// ProjectServer::useProject(503);
|
|
|
|
108
|
-// $newsCate = new NewsCategory();
|
|
|
|
109
|
-// $newsList = $newsCate->list();
|
|
|
|
110
|
-// foreach ($newsList as $v){
|
|
|
|
111
|
-// $data = [
|
|
|
|
112
|
-// 'name'=>$v['name'],
|
|
|
|
113
|
-// 'status'=>0,
|
|
|
|
114
|
-// 'sort'=>$v['sort'],
|
|
|
|
115
|
-// 'pid'=>$v['pid'],
|
|
|
|
116
|
-// 'route'=>$v['alias'],
|
|
|
|
117
|
-// 'project_id'=>503,
|
|
|
|
118
|
-// 'operator_id'=>$v['operator_id'],
|
|
|
|
119
|
-// 'create_id'=>1101,
|
|
|
|
120
|
-// 'module_id'=>10,
|
|
|
|
121
|
-// ];
|
|
|
|
122
|
-// $moduleCateModel = new CustomModuleCategory();
|
|
|
|
123
|
-// $id = $moduleCateModel->addReturnId($data);
|
|
|
|
124
|
-// RouteMap::setRoute($v['alias'],RouteMap::SOURCE_MODULE_CATE,$id,503);
|
|
|
|
125
|
-// }
|
|
|
|
126
|
-// DB::disconnect('custom_mysql');
|
|
|
|
127
|
-// }
|
|
|
|
128
|
} |
123
|
} |