正在显示
33 个修改的文件
包含
158 行增加
和
174 行删除
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Console\Commands; | 3 | +namespace App\Console\Commands\Domain; |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | +use App\Models\Devops\DevopsTask as DevopsTaskModel; | ||
| 6 | use App\Models\Devops\DevopsTaskLog; | 7 | use App\Models\Devops\DevopsTaskLog; |
| 7 | use App\Models\Project\Project; | 8 | use App\Models\Project\Project; |
| 8 | -use App\Utils\EncryptUtils; | ||
| 9 | use Illuminate\Console\Command; | 9 | use Illuminate\Console\Command; |
| 10 | -use App\Models\Devops\DevopsTask as DevopsTaskModel; | ||
| 11 | 10 | ||
| 12 | /** | 11 | /** |
| 13 | * Class DevopsTask | 12 | * Class DevopsTask |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Console\Commands; | 3 | +namespace App\Console\Commands\Domain; |
| 4 | 4 | ||
| 5 | -use App\Helper\Arr; | ||
| 6 | -use App\Models\Product\Category; | ||
| 7 | -use App\Models\Product\Product; | ||
| 8 | use App\Models\Project\OnlineCheck; | 5 | use App\Models\Project\OnlineCheck; |
| 9 | use App\Models\Project\Project; | 6 | use App\Models\Project\Project; |
| 10 | -use App\Models\RankData\RankData as GoogleRankModel; | ||
| 11 | -use App\Models\RouteMap\RouteMap; | ||
| 12 | -use GuzzleHttp\Client; | ||
| 13 | -use GuzzleHttp\Promise\Utils; | ||
| 14 | use Illuminate\Console\Command; | 7 | use Illuminate\Console\Command; |
| 15 | -use Illuminate\Support\Facades\DB; | ||
| 16 | -use Illuminate\Support\Str; | ||
| 17 | 8 | ||
| 18 | /** | 9 | /** |
| 19 | * 剩余服务时长 | 10 | * 剩余服务时长 |
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | * @time :2024/1/29 15:29 | 7 | * @time :2024/1/29 15:29 |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | -namespace App\Console\Commands; | 10 | +namespace App\Console\Commands\Domain; |
| 11 | 11 | ||
| 12 | use App\Models\Devops\ServerConfig; | 12 | use App\Models\Devops\ServerConfig; |
| 13 | use App\Models\Project\Project; | 13 | use App\Models\Project\Project; |
| @@ -7,11 +7,12 @@ | @@ -7,11 +7,12 @@ | ||
| 7 | * @time :2023/9/25 15:31 | 7 | * @time :2023/9/25 15:31 |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | -namespace App\Console\Commands; | 10 | +namespace App\Console\Commands\Import; |
| 11 | use App\Helper\OaGlobalsoApi; | 11 | use App\Helper\OaGlobalsoApi; |
| 12 | use App\Models\Channel\Channel; | 12 | use App\Models\Channel\Channel; |
| 13 | use App\Models\Project\Project; | 13 | use App\Models\Project\Project; |
| 14 | use Illuminate\Console\Command; | 14 | use Illuminate\Console\Command; |
| 15 | + | ||
| 15 | class ImportChannel extends Command | 16 | class ImportChannel extends Command |
| 16 | { | 17 | { |
| 17 | /** | 18 | /** |
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | * @time :2023/8/7 17:47 | 7 | * @time :2023/8/7 17:47 |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | -namespace App\Console\Commands; | 10 | +namespace App\Console\Commands\Import; |
| 11 | 11 | ||
| 12 | use App\Models\Manage\EntryPosition; | 12 | use App\Models\Manage\EntryPosition; |
| 13 | use App\Models\Manage\JobLevel; | 13 | use App\Models\Manage\JobLevel; |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Console\Commands; | 3 | +namespace App\Console\Commands\Project; |
| 4 | 4 | ||
| 5 | use App\Http\Logic\Aside\Project\ProjectLogic; | 5 | use App\Http\Logic\Aside\Project\ProjectLogic; |
| 6 | use App\Models\Com\NoticeLog; | 6 | use App\Models\Com\NoticeLog; |
| 7 | use App\Models\Project\Project; | 7 | use App\Models\Project\Project; |
| 8 | -use App\Services\ProjectServer; | ||
| 9 | use Illuminate\Console\Command; | 8 | use Illuminate\Console\Command; |
| 10 | -use Illuminate\Support\Facades\DB; | ||
| 11 | 9 | ||
| 12 | /** | 10 | /** |
| 13 | * 初始化项目 | 11 | * 初始化项目 |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Console\Commands; | 3 | +namespace App\Console\Commands\Project; |
| 4 | 4 | ||
| 5 | use App\Helper\Arr; | 5 | use App\Helper\Arr; |
| 6 | use App\Helper\Common; | 6 | use App\Helper\Common; |
| @@ -21,7 +21,6 @@ use App\Services\ProjectServer; | @@ -21,7 +21,6 @@ use App\Services\ProjectServer; | ||
| 21 | use App\Utils\LogUtils; | 21 | use App\Utils\LogUtils; |
| 22 | use Hashids\Hashids; | 22 | use Hashids\Hashids; |
| 23 | use Illuminate\Console\Command; | 23 | use Illuminate\Console\Command; |
| 24 | -use Illuminate\Database\Eloquent\Model; | ||
| 25 | use Illuminate\Support\Facades\DB; | 24 | use Illuminate\Support\Facades\DB; |
| 26 | use Illuminate\Support\Facades\Http; | 25 | use Illuminate\Support\Facades\Http; |
| 27 | 26 |
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | * @time :2024/4/17 10:05 | 7 | * @time :2024/4/17 10:05 |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | -namespace App\Console\Commands\SyncFile; | 10 | +namespace App\Console\Commands\Sync; |
| 11 | 11 | ||
| 12 | use App\Models\File\ErrorFile; | 12 | use App\Models\File\ErrorFile; |
| 13 | use Illuminate\Console\Command; | 13 | use Illuminate\Console\Command; |
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | * @time :2023/12/25 15:00 | 7 | * @time :2023/12/25 15:00 |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | -namespace App\Console\Commands; | 10 | +namespace App\Console\Commands\Sync; |
| 11 | 11 | ||
| 12 | use App\Models\User\User; | 12 | use App\Models\User\User; |
| 13 | use Illuminate\Console\Command; | 13 | use Illuminate\Console\Command; |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Console\Commands; | 3 | +namespace App\Console\Commands\Sync; |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | use App\Exceptions\InquiryFilterException; | 6 | use App\Exceptions\InquiryFilterException; |
| 7 | use App\Models\Project\Project; | 7 | use App\Models\Project\Project; |
| 8 | +use App\Models\SyncSubmitTask\SyncSubmitTask as SyncSubmitTaskModel; | ||
| 8 | use App\Services\SyncSubmitTaskService; | 9 | use App\Services\SyncSubmitTaskService; |
| 9 | use Illuminate\Console\Command; | 10 | use Illuminate\Console\Command; |
| 10 | -use App\Models\SyncSubmitTask\SyncSubmitTask as SyncSubmitTaskModel; | ||
| 11 | use Illuminate\Support\Facades\DB; | 11 | use Illuminate\Support\Facades\DB; |
| 12 | use Illuminate\Support\Facades\Redis; | 12 | use Illuminate\Support\Facades\Redis; |
| 13 | use Illuminate\Support\Facades\Schema; | 13 | use Illuminate\Support\Facades\Schema; |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Console\Commands; | 3 | +namespace App\Console\Commands\Tdk; |
| 4 | 4 | ||
| 5 | use App\Helper\Arr; | 5 | use App\Helper\Arr; |
| 6 | use App\Helper\Common; | 6 | use App\Helper\Common; |
| 7 | use App\Helper\Gpt; | 7 | use App\Helper\Gpt; |
| 8 | -use App\Helper\Translate; | ||
| 9 | use App\Models\Ai\AiCommand; | 8 | use App\Models\Ai\AiCommand; |
| 10 | use App\Models\Domain\DomainInfo; | 9 | use App\Models\Domain\DomainInfo; |
| 11 | use App\Models\Mail\Mail; | 10 | use App\Models\Mail\Mail; |
| @@ -16,7 +15,6 @@ use App\Models\User\User; | @@ -16,7 +15,6 @@ use App\Models\User\User; | ||
| 16 | use App\Models\WebSetting\WebLanguage; | 15 | use App\Models\WebSetting\WebLanguage; |
| 17 | use App\Services\ProjectServer; | 16 | use App\Services\ProjectServer; |
| 18 | use Illuminate\Console\Command; | 17 | use Illuminate\Console\Command; |
| 19 | -use Illuminate\Http\Request; | ||
| 20 | use Illuminate\Support\Facades\Cache; | 18 | use Illuminate\Support\Facades\Cache; |
| 21 | use Illuminate\Support\Facades\DB; | 19 | use Illuminate\Support\Facades\DB; |
| 22 | use Illuminate\Support\Facades\Redis; | 20 | use Illuminate\Support\Facades\Redis; |
| @@ -24,6 +24,8 @@ use App\Models\Product\Product; | @@ -24,6 +24,8 @@ use App\Models\Product\Product; | ||
| 24 | use App\Models\Project\DeployOptimize; | 24 | use App\Models\Project\DeployOptimize; |
| 25 | use App\Models\Project\MinorLanguages; | 25 | use App\Models\Project\MinorLanguages; |
| 26 | use App\Models\Project\Project; | 26 | use App\Models\Project\Project; |
| 27 | +use App\Models\RouteMap\RouteMap; | ||
| 28 | +use App\Models\Template\BCustomTemplate; | ||
| 27 | use App\Models\WebSetting\WebSettingService; | 29 | use App\Models\WebSetting\WebSettingService; |
| 28 | use App\Services\ProjectServer; | 30 | use App\Services\ProjectServer; |
| 29 | use App\Services\SyncService; | 31 | use App\Services\SyncService; |
| @@ -49,6 +51,50 @@ class Demo extends Command | @@ -49,6 +51,50 @@ class Demo extends Command | ||
| 49 | protected $description = 'demo'; | 51 | protected $description = 'demo'; |
| 50 | 52 | ||
| 51 | public function handle(){ | 53 | public function handle(){ |
| 54 | + $projectModel = new Project(); | ||
| 55 | + $list = $projectModel->list(['is_upgrade'=>0]); | ||
| 56 | + foreach ($list as $v){ | ||
| 57 | + echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | ||
| 58 | + ProjectServer::useProject($v['id']); | ||
| 59 | + $this->initSearch($v['id']); | ||
| 60 | + DB::disconnect('custom_mysql'); | ||
| 61 | + } | ||
| 62 | + echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | ||
| 63 | + } | ||
| 52 | 64 | ||
| 65 | + /** | ||
| 66 | + * @remark :创建search页面 | ||
| 67 | + * @name :initSearch | ||
| 68 | + * @author :lyh | ||
| 69 | + * @method :post | ||
| 70 | + * @time :2024/4/25 11:35 | ||
| 71 | + */ | ||
| 72 | + public function initSearch($project_id){ | ||
| 73 | + $bCustomTemplateModel = new BCustomTemplate(); | ||
| 74 | + $info = $bCustomTemplateModel->read(['url'=>'search']); | ||
| 75 | + if($info === false){ | ||
| 76 | + $time = date('Y-m-d H:i:s'); | ||
| 77 | + $info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first(); | ||
| 78 | + if(empty($info)) { | ||
| 79 | + $data = [ | ||
| 80 | + 'project_id' => $project_id, | ||
| 81 | + 'name' => 'search', | ||
| 82 | + 'status' => 1, | ||
| 83 | + 'url' => 'search', | ||
| 84 | + 'html' => '', | ||
| 85 | + 'html_style' =>'search', | ||
| 86 | + 'title' => 'search', | ||
| 87 | + 'description' => 'Sorry. The page has either moved or cannot be found.', | ||
| 88 | + 'created_at' => $time, 'updated_at' => $time]; | ||
| 89 | + $id = DB::connection('custom_mysql')->table('gl_web_custom_template')->insertGetId($data); | ||
| 90 | + //路由 | ||
| 91 | + $info = DB::connection('custom_mysql')->table('gl_route_map')->first(); | ||
| 92 | + if(empty($info)) { | ||
| 93 | + $data = ['project_id' => $project_id, 'source' => RouteMap::SOURCE_PAGE, 'source_id' => $id, 'route' => 'search', 'created_at' => $time, 'updated_at' => $time]; | ||
| 94 | + DB::connection('custom_mysql')->table('gl_route_map')->insert($data); | ||
| 95 | + } | ||
| 96 | + } | ||
| 97 | + } | ||
| 98 | + return true; | ||
| 53 | } | 99 | } |
| 54 | } | 100 | } |
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | * @time :2023/11/13 10:06 | 7 | * @time :2023/11/13 10:06 |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | -namespace App\Console\Commands; | 10 | +namespace App\Console\Commands\Test; |
| 11 | 11 | ||
| 12 | use App\Models\Project\Project; | 12 | use App\Models\Project\Project; |
| 13 | use App\Models\RouteMap\RouteMap; | 13 | use App\Models\RouteMap\RouteMap; |
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | * @time :2023/11/30 10:29 | 7 | * @time :2023/11/30 10:29 |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | -namespace App\Console\Commands; | 10 | +namespace App\Console\Commands\Test; |
| 11 | 11 | ||
| 12 | use App\Models\WebSetting\WebLanguage; | 12 | use App\Models\WebSetting\WebLanguage; |
| 13 | use Illuminate\Console\Command; | 13 | use Illuminate\Console\Command; |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Console\Commands; | 3 | +namespace App\Console\Commands\Test; |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | 6 | ||
| @@ -15,9 +15,6 @@ use App\Models\SyncSubmitTask\SyncSubmitTask as SyncSubmitTaskModel; | @@ -15,9 +15,6 @@ use App\Models\SyncSubmitTask\SyncSubmitTask as SyncSubmitTaskModel; | ||
| 15 | use App\Models\WebSetting\Translate as TranslateModel; | 15 | use App\Models\WebSetting\Translate as TranslateModel; |
| 16 | use App\Services\ProjectServer; | 16 | use App\Services\ProjectServer; |
| 17 | use Illuminate\Console\Command; | 17 | use Illuminate\Console\Command; |
| 18 | -use Illuminate\Database\Eloquent\Model; | ||
| 19 | -use Illuminate\Support\Facades\DB; | ||
| 20 | -use mysql_xdevapi\Exception; | ||
| 21 | 18 | ||
| 22 | /** | 19 | /** |
| 23 | * Class Test | 20 | * Class Test |
| @@ -7,22 +7,15 @@ | @@ -7,22 +7,15 @@ | ||
| 7 | * @time :2023/11/20 15:07 | 7 | * @time :2023/11/20 15:07 |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | -namespace App\Console\Commands; | 10 | +namespace App\Console\Commands\Test; |
| 11 | 11 | ||
| 12 | use App\Models\Blog\Blog; | 12 | use App\Models\Blog\Blog; |
| 13 | use App\Models\Blog\BlogCategory; | 13 | use App\Models\Blog\BlogCategory; |
| 14 | use App\Models\CustomModule\CustomModule; | 14 | use App\Models\CustomModule\CustomModule; |
| 15 | use App\Models\CustomModule\CustomModuleCategory; | 15 | use App\Models\CustomModule\CustomModuleCategory; |
| 16 | use App\Models\CustomModule\CustomModuleContent; | 16 | use App\Models\CustomModule\CustomModuleContent; |
| 17 | -use App\Models\News\News; | ||
| 18 | -use App\Models\News\NewsCategory; | ||
| 19 | -use App\Models\Product\Category; | ||
| 20 | -use App\Models\Product\Keyword; | ||
| 21 | -use App\Models\Product\Product; | ||
| 22 | use App\Models\Project\Project; | 17 | use App\Models\Project\Project; |
| 23 | use App\Models\RouteMap\RouteMap; | 18 | use App\Models\RouteMap\RouteMap; |
| 24 | -use App\Models\Template\BTemplate; | ||
| 25 | -use App\Models\Template\BTemplateMain; | ||
| 26 | use App\Services\ProjectServer; | 19 | use App\Services\ProjectServer; |
| 27 | use Illuminate\Console\Command; | 20 | use Illuminate\Console\Command; |
| 28 | use Illuminate\Support\Facades\DB; | 21 | use Illuminate\Support\Facades\DB; |
app/Console/Commands/UpdateProductCategory.php
→
app/Console/Commands/Test/UpdateProductCategory.php
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | * @time :2023/12/6 16:07 | 7 | * @time :2023/12/6 16:07 |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | -namespace App\Console\Commands; | 10 | +namespace App\Console\Commands\Test; |
| 11 | 11 | ||
| 12 | use App\Models\Product\Category; | 12 | use App\Models\Product\Category; |
| 13 | use App\Models\Product\CategoryRelated; | 13 | use App\Models\Product\CategoryRelated; |
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | * @time :2023/11/1 9:22 | 7 | * @time :2023/11/1 9:22 |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | -namespace App\Console\Commands; | 10 | +namespace App\Console\Commands\Test; |
| 11 | 11 | ||
| 12 | use App\Models\Mail\Mail; | 12 | use App\Models\Mail\Mail; |
| 13 | use App\Models\Project\Project; | 13 | use App\Models\Project\Project; |
| @@ -15,8 +15,6 @@ use App\Models\User\User; | @@ -15,8 +15,6 @@ use App\Models\User\User; | ||
| 15 | use App\Services\ProjectServer; | 15 | use App\Services\ProjectServer; |
| 16 | use Illuminate\Console\Command; | 16 | use Illuminate\Console\Command; |
| 17 | use Illuminate\Support\Facades\DB; | 17 | use Illuminate\Support\Facades\DB; |
| 18 | -use Illuminate\Support\Facades\Redis; | ||
| 19 | -use App\Models\Com\UpdateProgress as UpdateProgressModel; | ||
| 20 | 18 | ||
| 21 | class UpdateProgress extends Command | 19 | class UpdateProgress extends Command |
| 22 | { | 20 | { |
| @@ -7,18 +7,16 @@ | @@ -7,18 +7,16 @@ | ||
| 7 | * @time :2023/11/20 15:07 | 7 | * @time :2023/11/20 15:07 |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | -namespace App\Console\Commands; | 10 | +namespace App\Console\Commands\Test; |
| 11 | 11 | ||
| 12 | use App\Helper\Arr; | 12 | use App\Helper\Arr; |
| 13 | use App\Helper\Translate; | 13 | use App\Helper\Translate; |
| 14 | use App\Models\CustomModule\CustomModuleCategory; | 14 | use App\Models\CustomModule\CustomModuleCategory; |
| 15 | -use App\Models\CustomModule\CustomModuleContent; | ||
| 16 | use App\Models\Product\CategoryRelated; | 15 | use App\Models\Product\CategoryRelated; |
| 17 | use App\Models\Product\Keyword; | 16 | use App\Models\Product\Keyword; |
| 18 | use App\Models\Product\Product; | 17 | use App\Models\Product\Product; |
| 19 | use App\Models\Project\Project; | 18 | use App\Models\Project\Project; |
| 20 | use App\Models\RouteMap\RouteMap; | 19 | use App\Models\RouteMap\RouteMap; |
| 21 | -use App\Models\Template\BTemplate; | ||
| 22 | use App\Services\ProjectServer; | 20 | use App\Services\ProjectServer; |
| 23 | use Illuminate\Console\Command; | 21 | use Illuminate\Console\Command; |
| 24 | use Illuminate\Support\Facades\DB; | 22 | use Illuminate\Support\Facades\DB; |
app/Console/Commands/TranslateRead.php
已删除
100644 → 0
| 1 | -<?php | ||
| 2 | -/** | ||
| 3 | - * @remark : | ||
| 4 | - * @name :TranslateRead.php | ||
| 5 | - * @author :lyh | ||
| 6 | - * @method :post | ||
| 7 | - * @time :2024/1/17 16:47 | ||
| 8 | - */ | ||
| 9 | - | ||
| 10 | -namespace App\Console\Commands; | ||
| 11 | - | ||
| 12 | -use App\Models\Project\Project; | ||
| 13 | -use App\Services\ProjectServer; | ||
| 14 | -use Illuminate\Console\Command; | ||
| 15 | -use Illuminate\Support\Facades\DB; | ||
| 16 | - | ||
| 17 | -class TranslateRead extends Command | ||
| 18 | -{ | ||
| 19 | - /** | ||
| 20 | - * The name and signature of the console command. | ||
| 21 | - * | ||
| 22 | - * @var string | ||
| 23 | - */ | ||
| 24 | - protected $signature = 'translate_read'; | ||
| 25 | - | ||
| 26 | - /** | ||
| 27 | - * The console command description. | ||
| 28 | - * | ||
| 29 | - * @var string | ||
| 30 | - */ | ||
| 31 | - protected $description = '生成视频模块'; | ||
| 32 | - | ||
| 33 | - /** | ||
| 34 | - * @remark :统一更新路由 | ||
| 35 | - * @name :handle | ||
| 36 | - * @author :lyh | ||
| 37 | - * @method :post | ||
| 38 | - * @time :2023/11/20 15:13 | ||
| 39 | - */ | ||
| 40 | - public function handle(){ | ||
| 41 | - $projectModel = new Project(); | ||
| 42 | - $list = $projectModel->list(['type'=>['!=',0]]); | ||
| 43 | - foreach ($list as $v){ | ||
| 44 | - echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | ||
| 45 | - ProjectServer::useProject($v['id']); | ||
| 46 | - DB::disconnect('custom_mysql'); | ||
| 47 | - } | ||
| 48 | - echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | ||
| 49 | - } | ||
| 50 | - | ||
| 51 | - public function read(){ | ||
| 52 | - | ||
| 53 | - } | ||
| 54 | -} |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Console\Commands; | 3 | +namespace App\Console\Commands\WebTraffic; |
| 4 | 4 | ||
| 5 | use App\Helper\Arr; | 5 | use App\Helper\Arr; |
| 6 | use App\Models\Product\Category; | 6 | use App\Models\Product\Category; |
| @@ -8,7 +8,6 @@ use App\Models\Product\Product; | @@ -8,7 +8,6 @@ use App\Models\Product\Product; | ||
| 8 | use App\Models\Project\OnlineCheck; | 8 | use App\Models\Project\OnlineCheck; |
| 9 | use App\Models\Project\Project; | 9 | use App\Models\Project\Project; |
| 10 | use App\Models\Project\WebTrafficConfig; | 10 | use App\Models\Project\WebTrafficConfig; |
| 11 | -use App\Models\Template\BCustomTemplate; | ||
| 12 | use App\Models\WebSetting\WebLanguage; | 11 | use App\Models\WebSetting\WebLanguage; |
| 13 | use App\Services\ProjectServer; | 12 | use App\Services\ProjectServer; |
| 14 | use Carbon\Carbon; | 13 | use Carbon\Carbon; |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Console\Commands; | 3 | +namespace App\Console\Commands\WebTraffic; |
| 4 | 4 | ||
| 5 | use App\Helper\Arr; | 5 | use App\Helper\Arr; |
| 6 | use App\Models\Product\Category; | 6 | use App\Models\Product\Category; |
| @@ -8,7 +8,6 @@ use App\Models\Product\Product; | @@ -8,7 +8,6 @@ use App\Models\Product\Product; | ||
| 8 | use App\Models\Project\OnlineCheck; | 8 | use App\Models\Project\OnlineCheck; |
| 9 | use App\Models\Project\Project; | 9 | use App\Models\Project\Project; |
| 10 | use App\Models\Project\WebTrafficConfig; | 10 | use App\Models\Project\WebTrafficConfig; |
| 11 | -use App\Models\Template\BCustomTemplate; | ||
| 12 | use App\Models\WebSetting\WebLanguage; | 11 | use App\Models\WebSetting\WebLanguage; |
| 13 | use App\Services\ProjectServer; | 12 | use App\Services\ProjectServer; |
| 14 | use Carbon\Carbon; | 13 | use Carbon\Carbon; |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Console\Commands; | 3 | +namespace App\Console\Commands\WebTraffic; |
| 4 | 4 | ||
| 5 | use App\Helper\Arr; | 5 | use App\Helper\Arr; |
| 6 | use App\Models\Product\Category; | 6 | use App\Models\Product\Category; |
| @@ -8,10 +8,8 @@ use App\Models\Product\Product; | @@ -8,10 +8,8 @@ use App\Models\Product\Product; | ||
| 8 | use App\Models\Project\OnlineCheck; | 8 | use App\Models\Project\OnlineCheck; |
| 9 | use App\Models\Project\Project; | 9 | use App\Models\Project\Project; |
| 10 | use App\Models\Project\WebTrafficConfig; | 10 | use App\Models\Project\WebTrafficConfig; |
| 11 | -use App\Models\Template\BCustomTemplate; | ||
| 12 | use App\Models\WebSetting\WebLanguage; | 11 | use App\Models\WebSetting\WebLanguage; |
| 13 | use App\Services\ProjectServer; | 12 | use App\Services\ProjectServer; |
| 14 | -use Carbon\Carbon; | ||
| 15 | use GuzzleHttp\Client; | 13 | use GuzzleHttp\Client; |
| 16 | use GuzzleHttp\Promise\Utils; | 14 | use GuzzleHttp\Promise\Utils; |
| 17 | use Illuminate\Console\Command; | 15 | use Illuminate\Console\Command; |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -namespace App\Console\Commands; | 3 | +namespace App\Console\Commands\WebTraffic; |
| 4 | 4 | ||
| 5 | use App\Helper\Arr; | 5 | use App\Helper\Arr; |
| 6 | use App\Models\Product\Category; | 6 | use App\Models\Product\Category; |
| @@ -8,10 +8,8 @@ use App\Models\Product\Product; | @@ -8,10 +8,8 @@ use App\Models\Product\Product; | ||
| 8 | use App\Models\Project\OnlineCheck; | 8 | use App\Models\Project\OnlineCheck; |
| 9 | use App\Models\Project\Project; | 9 | use App\Models\Project\Project; |
| 10 | use App\Models\Project\WebTrafficConfig; | 10 | use App\Models\Project\WebTrafficConfig; |
| 11 | -use App\Models\Template\BCustomTemplate; | ||
| 12 | use App\Models\WebSetting\WebLanguage; | 11 | use App\Models\WebSetting\WebLanguage; |
| 13 | use App\Services\ProjectServer; | 12 | use App\Services\ProjectServer; |
| 14 | -use Carbon\Carbon; | ||
| 15 | use GuzzleHttp\Client; | 13 | use GuzzleHttp\Client; |
| 16 | use GuzzleHttp\Promise\Utils; | 14 | use GuzzleHttp\Promise\Utils; |
| 17 | use Illuminate\Console\Command; | 15 | use Illuminate\Console\Command; |
| @@ -2,19 +2,34 @@ | @@ -2,19 +2,34 @@ | ||
| 2 | 2 | ||
| 3 | namespace App\Http\Logic\Aside\Project; | 3 | namespace App\Http\Logic\Aside\Project; |
| 4 | 4 | ||
| 5 | -use App\Console\Commands\Languages; | ||
| 6 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 7 | use App\Events\CopyImageFile; | 6 | use App\Events\CopyImageFile; |
| 8 | use App\Events\CopyProject; | 7 | use App\Events\CopyProject; |
| 9 | use App\Exceptions\AsideGlobalException; | 8 | use App\Exceptions\AsideGlobalException; |
| 9 | +use App\Helper\Arr; | ||
| 10 | +use App\Helper\Common; | ||
| 11 | +use App\Helper\FormGlobalsoApi; | ||
| 12 | +use App\Http\Logic\Aside\BaseLogic; | ||
| 13 | +use App\Http\Logic\Aside\Domain\DomainInfoLogic; | ||
| 10 | use App\Jobs\CopyImageFileJob; | 14 | use App\Jobs\CopyImageFileJob; |
| 11 | use App\Jobs\CopyProjectJob; | 15 | use App\Jobs\CopyProjectJob; |
| 16 | +use App\Models\Channel\Channel; | ||
| 17 | +use App\Models\Channel\User; | ||
| 18 | +use App\Models\Channel\Zone; | ||
| 12 | use App\Models\Com\NoticeLog; | 19 | use App\Models\Com\NoticeLog; |
| 13 | use App\Models\Com\UpdateLog; | 20 | use App\Models\Com\UpdateLog; |
| 14 | use App\Models\Devops\ServerConfig; | 21 | use App\Models\Devops\ServerConfig; |
| 22 | +use App\Models\Domain\DomainInfo; | ||
| 15 | use App\Models\Inquiry\InquiryIP; | 23 | use App\Models\Inquiry\InquiryIP; |
| 24 | +use App\Models\Inquiry\InquirySet; | ||
| 25 | +use App\Models\Manage\Manage; | ||
| 26 | +use App\Models\Project\After; | ||
| 27 | +use App\Models\Project\DeployBuild; | ||
| 28 | +use App\Models\Project\DeployOptimize; | ||
| 16 | use App\Models\Project\InquiryFilterConfig; | 29 | use App\Models\Project\InquiryFilterConfig; |
| 17 | use App\Models\Project\MinorLanguages; | 30 | use App\Models\Project\MinorLanguages; |
| 31 | +use App\Models\Project\Payment; | ||
| 32 | +use App\Models\Project\Project; | ||
| 18 | use App\Models\Project\ProjectRenew; | 33 | use App\Models\Project\ProjectRenew; |
| 19 | use App\Models\Project\WebTrafficConfig; | 34 | use App\Models\Project\WebTrafficConfig; |
| 20 | use App\Models\RankData\ExternalLinks; | 35 | use App\Models\RankData\ExternalLinks; |
| @@ -23,38 +38,18 @@ use App\Models\RankData\RankData; | @@ -23,38 +38,18 @@ use App\Models\RankData\RankData; | ||
| 23 | use App\Models\RankData\RankWeek; | 38 | use App\Models\RankData\RankWeek; |
| 24 | use App\Models\RankData\RecommDomain; | 39 | use App\Models\RankData\RecommDomain; |
| 25 | use App\Models\RankData\Speed; | 40 | use App\Models\RankData\Speed; |
| 26 | -use App\Models\Template\Setting; | ||
| 27 | use App\Models\User\ProjectMenu; | 41 | use App\Models\User\ProjectMenu; |
| 28 | use App\Models\User\ProjectRole; | 42 | use App\Models\User\ProjectRole; |
| 43 | +use App\Models\User\User as UserModel; | ||
| 29 | use App\Models\WebSetting\WebLanguage; | 44 | use App\Models\WebSetting\WebLanguage; |
| 45 | +use App\Services\ProjectServer; | ||
| 30 | use App\Services\SyncService; | 46 | use App\Services\SyncService; |
| 31 | use App\Utils\HttpUtils; | 47 | use App\Utils\HttpUtils; |
| 32 | use App\Utils\LogUtils; | 48 | use App\Utils\LogUtils; |
| 33 | use GuzzleHttp\Exception\GuzzleException; | 49 | use GuzzleHttp\Exception\GuzzleException; |
| 34 | -use App\Helper\Arr; | ||
| 35 | -use App\Helper\Common; | ||
| 36 | -use App\Helper\FormGlobalsoApi; | ||
| 37 | -use App\Http\Logic\Aside\BaseLogic; | ||
| 38 | -use App\Models\Channel\Channel; | ||
| 39 | -use App\Models\Channel\User; | ||
| 40 | -use App\Models\Channel\Zone; | ||
| 41 | -use App\Models\Domain\DomainInfo; | ||
| 42 | -use App\Models\Inquiry\InquirySet; | ||
| 43 | -use App\Models\Manage\Manage; | ||
| 44 | -use App\Models\Project\After; | ||
| 45 | -use App\Models\Project\DeployBuild; | ||
| 46 | -use App\Models\Project\DeployOptimize; | ||
| 47 | -use App\Models\Project\Payment; | ||
| 48 | -use App\Models\Project\Project; | ||
| 49 | -use App\Models\Task\Task; | ||
| 50 | -use App\Services\ProjectServer; | ||
| 51 | -use Hashids\Hashids; | ||
| 52 | -use App\Models\User\User as UserModel; | ||
| 53 | use Illuminate\Support\Facades\Cache; | 50 | use Illuminate\Support\Facades\Cache; |
| 54 | use Illuminate\Support\Facades\DB; | 51 | use Illuminate\Support\Facades\DB; |
| 55 | use Illuminate\Support\Facades\Http; | 52 | use Illuminate\Support\Facades\Http; |
| 56 | -use Illuminate\Support\Facades\Schema; | ||
| 57 | -use App\Http\Logic\Aside\Domain\DomainInfoLogic; | ||
| 58 | 53 | ||
| 59 | /** | 54 | /** |
| 60 | * Class ProjectLogic | 55 | * Class ProjectLogic |
| @@ -386,10 +386,8 @@ class CustomTemplateLogic extends BaseLogic | @@ -386,10 +386,8 @@ class CustomTemplateLogic extends BaseLogic | ||
| 386 | $type = $this->getType(); | 386 | $type = $this->getType(); |
| 387 | //还原头部+底部 | 387 | //还原头部+底部 |
| 388 | $commonData = [ | 388 | $commonData = [ |
| 389 | - 'head_html'=>$logInfo['head_html'], | ||
| 390 | - 'head_css'=>$logInfo['head_css'], | ||
| 391 | - 'footer_html'=>$logInfo['footer_html'], | ||
| 392 | - 'footer_css'=>$logInfo['footer_css'] | 389 | + 'head_html'=>$logInfo['head_html'], 'head_css'=>$logInfo['head_css'], |
| 390 | + 'footer_html'=>$logInfo['footer_html'], 'footer_css'=>$logInfo['footer_css'] | ||
| 393 | ]; | 391 | ]; |
| 394 | $commonTemplateModel = new BTemplateCommon(); | 392 | $commonTemplateModel = new BTemplateCommon(); |
| 395 | $commonTemplateModel->edit($commonData,['template_id'=>$logInfo['template_id'],'type'=>$type,'project_id'=>$this->user['project_id']]); | 393 | $commonTemplateModel->edit($commonData,['template_id'=>$logInfo['template_id'],'type'=>$type,'project_id'=>$this->user['project_id']]); |
| @@ -21,6 +21,33 @@ use Illuminate\Support\Facades\Schema; | @@ -21,6 +21,33 @@ use Illuminate\Support\Facades\Schema; | ||
| 21 | */ | 21 | */ |
| 22 | class ProjectServer | 22 | class ProjectServer |
| 23 | { | 23 | { |
| 24 | + public static $main404Html = '<main> | ||
| 25 | + <section data-section="section" data-screen="screen-large" class="section-404-wrap-block section-block-error404" | ||
| 26 | + id="sectionIdyxqu938"> | ||
| 27 | + <div class="layout" data-unable="demo01-error404"> | ||
| 28 | + <img src="https://ecdn6.globalso.com/upload/m/image_other/2023-10/6528a87e594db30162.png" /> | ||
| 29 | + </div> | ||
| 30 | + <p style="text-align: center">SORRY. THE PAGE HAS EITHER MOVED OR CANNOT BE FOUND.</p> | ||
| 31 | + <style> | ||
| 32 | + .section-block-error404 .layout { | ||
| 33 | + height: 700px; | ||
| 34 | + display: flex; | ||
| 35 | + align-items: center; | ||
| 36 | + justify-content: center; | ||
| 37 | + } | ||
| 38 | + .section-block-error404 img { | ||
| 39 | + width: 400px; | ||
| 40 | + } | ||
| 41 | + @media only screen and (max-width:500) { | ||
| 42 | + .section-block-error404 img { | ||
| 43 | + max-width: 100%; | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + </style> | ||
| 47 | + <script> | ||
| 48 | + </script> | ||
| 49 | + </section> | ||
| 50 | + </main>'; | ||
| 24 | /** | 51 | /** |
| 25 | * @param $project_id | 52 | * @param $project_id |
| 26 | * @return Project|false | 53 | * @return Project|false |
| @@ -105,6 +132,8 @@ class ProjectServer | @@ -105,6 +132,8 @@ class ProjectServer | ||
| 105 | self::init404Page($project_id); | 132 | self::init404Page($project_id); |
| 106 | //初始化模块数据 | 133 | //初始化模块数据 |
| 107 | self::initModule($project_id); | 134 | self::initModule($project_id); |
| 135 | + //初始化search页面 | ||
| 136 | + self::initSearchPage($project_id); | ||
| 108 | DB::disconnect('custom_mysql'); | 137 | DB::disconnect('custom_mysql'); |
| 109 | return true; | 138 | return true; |
| 110 | } | 139 | } |
| @@ -174,39 +203,12 @@ class ProjectServer | @@ -174,39 +203,12 @@ class ProjectServer | ||
| 174 | $time = date('Y-m-d H:i:s'); | 203 | $time = date('Y-m-d H:i:s'); |
| 175 | $info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first(); | 204 | $info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first(); |
| 176 | if(empty($info)) { | 205 | if(empty($info)) { |
| 177 | - $main_404_html = '<main> | ||
| 178 | - <section data-section="section" data-screen="screen-large" class="section-404-wrap-block section-block-error404" | ||
| 179 | - id="sectionIdyxqu938"> | ||
| 180 | - <div class="layout" data-unable="demo01-error404"> | ||
| 181 | - <img src="https://ecdn6.globalso.com/upload/m/image_other/2023-10/6528a87e594db30162.png" /> | ||
| 182 | - </div> | ||
| 183 | - <p style="text-align: center">SORRY. THE PAGE HAS EITHER MOVED OR CANNOT BE FOUND.</p> | ||
| 184 | - <style> | ||
| 185 | - .section-block-error404 .layout { | ||
| 186 | - height: 700px; | ||
| 187 | - display: flex; | ||
| 188 | - align-items: center; | ||
| 189 | - justify-content: center; | ||
| 190 | - } | ||
| 191 | - .section-block-error404 img { | ||
| 192 | - width: 400px; | ||
| 193 | - } | ||
| 194 | - @media only screen and (max-width:500) { | ||
| 195 | - .section-block-error404 img { | ||
| 196 | - max-width: 100%; | ||
| 197 | - } | ||
| 198 | - } | ||
| 199 | - </style> | ||
| 200 | - <script> | ||
| 201 | - </script> | ||
| 202 | - </section> | ||
| 203 | - </main>'; | ||
| 204 | $data = [ | 206 | $data = [ |
| 205 | 'project_id' => $project_id, | 207 | 'project_id' => $project_id, |
| 206 | 'name' => BCustomTemplate::NOT_FOUND_PAGE_URL, | 208 | 'name' => BCustomTemplate::NOT_FOUND_PAGE_URL, |
| 207 | 'status' => 1, | 209 | 'status' => 1, |
| 208 | 'url' => BCustomTemplate::NOT_FOUND_PAGE_URL, | 210 | 'url' => BCustomTemplate::NOT_FOUND_PAGE_URL, |
| 209 | - 'html' => $main_404_html, | 211 | + 'html' => self::$main404Html, |
| 210 | 'html_style' => '<style id="globalsojs-styles"></style>', | 212 | 'html_style' => '<style id="globalsojs-styles"></style>', |
| 211 | 'title' => '404-Page not found', | 213 | 'title' => '404-Page not found', |
| 212 | 'description' => 'Sorry. The page has either moved or cannot be found.', | 214 | 'description' => 'Sorry. The page has either moved or cannot be found.', |
| @@ -220,4 +222,35 @@ class ProjectServer | @@ -220,4 +222,35 @@ class ProjectServer | ||
| 220 | } | 222 | } |
| 221 | } | 223 | } |
| 222 | } | 224 | } |
| 225 | + | ||
| 226 | + /** | ||
| 227 | + * @remark :初始化search页面 | ||
| 228 | + * @name :init404Page | ||
| 229 | + * @author :lyh | ||
| 230 | + * @method :post | ||
| 231 | + * @time :2023/12/29 9:32 | ||
| 232 | + */ | ||
| 233 | + public static function initSearchPage($project_id){ | ||
| 234 | + $time = date('Y-m-d H:i:s'); | ||
| 235 | + $info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first(); | ||
| 236 | + if(empty($info)) { | ||
| 237 | + $data = [ | ||
| 238 | + 'project_id' => $project_id, | ||
| 239 | + 'name' => 'search', | ||
| 240 | + 'status' => 1, | ||
| 241 | + 'url' => 'search', | ||
| 242 | + 'html' => '', | ||
| 243 | + 'html_style' =>'search', | ||
| 244 | + 'title' => 'search', | ||
| 245 | + 'description' => 'Sorry. The page has either moved or cannot be found.', | ||
| 246 | + 'created_at' => $time, 'updated_at' => $time]; | ||
| 247 | + $id = DB::connection('custom_mysql')->table('gl_web_custom_template')->insertGetId($data); | ||
| 248 | + //路由 | ||
| 249 | + $info = DB::connection('custom_mysql')->table('gl_route_map')->first(); | ||
| 250 | + if(empty($info)) { | ||
| 251 | + $data = ['project_id' => $project_id, 'source' => RouteMap::SOURCE_PAGE, 'source_id' => $id, 'route' => 'search', 'created_at' => $time, 'updated_at' => $time]; | ||
| 252 | + DB::connection('custom_mysql')->table('gl_route_map')->insert($data); | ||
| 253 | + } | ||
| 254 | + } | ||
| 255 | + } | ||
| 223 | } | 256 | } |
-
请 注册 或 登录 后发表评论