作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

正在显示 45 个修改的文件 包含 345 行增加198 行删除
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\Inquiry;
4 4
5 use App\Helper\FormGlobalsoApi; 5 use App\Helper\FormGlobalsoApi;
6 use App\Models\Inquiry\InquiryFormData; 6 use App\Models\Inquiry\InquiryFormData;
@@ -129,7 +129,7 @@ class VideoTask extends Command @@ -129,7 +129,7 @@ class VideoTask extends Command
129 */ 129 */
130 public function sendSubTask() 130 public function sendSubTask()
131 { 131 {
132 - $subTask = KeywordVideoTaskLog::where(['status' => KeywordVideoTaskLog::STATUS_INIT])->orderBy('id', 'asc')->limit($this->max_sub_task)->get(); 132 + $subTask = KeywordVideoTaskLog::where(['status' => KeywordVideoTaskLog::STATUS_INIT])->orderBy('id', 'asc')->get();
133 if ($subTask->isEmpty()){ 133 if ($subTask->isEmpty()){
134 return true; 134 return true;
135 } 135 }
@@ -148,11 +148,12 @@ class VideoTask extends Command @@ -148,11 +148,12 @@ class VideoTask extends Command
148 ], 148 ],
149 'task_id' => $task_id, 149 'task_id' => $task_id,
150 'callback_url' => env('APP_URL') . '/api/video_task_callback', 150 'callback_url' => env('APP_URL') . '/api/video_task_callback',
151 - 'is_ytb'=>true 151 + 'is_ytb'=>false
152 ]; 152 ];
153 $result = Http::post('http://216.250.255.116:7866/create_task', $data); 153 $result = Http::post('http://216.250.255.116:7866/create_task', $data);
154 $res_json = json_decode($result,true); 154 $res_json = json_decode($result,true);
155 $val->task_id = $task_id; 155 $val->task_id = $task_id;
  156 + $val->status = KeywordVideoTaskLog::STATUS_ERROR;
156 if(isset($res_json['code']) && ($res_json['code'] == 200)){ 157 if(isset($res_json['code']) && ($res_json['code'] == 200)){
157 $val->status = KeywordVideoTaskLog::STATUS_RUNNING; 158 $val->status = KeywordVideoTaskLog::STATUS_RUNNING;
158 } 159 }
1 <?php 1 <?php
2 2
3 -namespace App\Console\Commands; 3 +namespace App\Console\Commands\Project;
4 4
5 use App\Models\Com\NoticeLog; 5 use App\Models\Com\NoticeLog;
6 use App\Models\Product\Keyword; 6 use App\Models\Product\Keyword;
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
1 <?php 1 <?php
2 2
3 -namespace App\Console\Commands; 3 +namespace App\Console\Commands\Sync;
4 4
5 5
6 use App\Helper\OaGlobalsoApi; 6 use App\Helper\OaGlobalsoApi;
@@ -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 5
6 use App\Services\ProjectServer; 6 use App\Services\ProjectServer;
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;
1 <?php 1 <?php
2 2
3 -namespace App\Console\Commands; 3 +namespace App\Console\Commands\Tdk;
4 4
5 use App\Models\Project\Project; 5 use App\Models\Project\Project;
6 use App\Models\Project\ProjectUpdateTdk; 6 use App\Models\Project\ProjectUpdateTdk;
@@ -12,7 +12,9 @@ use App\Models\Blog\Blog; @@ -12,7 +12,9 @@ use App\Models\Blog\Blog;
12 use App\Models\Devops\ServerConfig; 12 use App\Models\Devops\ServerConfig;
13 use App\Models\Domain\DomainInfo; 13 use App\Models\Domain\DomainInfo;
14 use App\Models\File\File; 14 use App\Models\File\File;
  15 +use App\Models\File\File as FileModel;
15 use App\Models\File\Image; 16 use App\Models\File\Image;
  17 +use App\Models\File\Image as ImageModel;
16 use App\Models\Manage\BelongingGroup; 18 use App\Models\Manage\BelongingGroup;
17 use App\Models\Manage\Dept; 19 use App\Models\Manage\Dept;
18 use App\Models\Manage\EntryPosition; 20 use App\Models\Manage\EntryPosition;
@@ -24,7 +26,10 @@ use App\Models\Product\Product; @@ -24,7 +26,10 @@ use App\Models\Product\Product;
24 use App\Models\Project\DeployOptimize; 26 use App\Models\Project\DeployOptimize;
25 use App\Models\Project\MinorLanguages; 27 use App\Models\Project\MinorLanguages;
26 use App\Models\Project\Project; 28 use App\Models\Project\Project;
  29 +use App\Models\RouteMap\RouteMap;
  30 +use App\Models\Template\BCustomTemplate;
27 use App\Models\WebSetting\WebSettingService; 31 use App\Models\WebSetting\WebSettingService;
  32 +use App\Services\AmazonS3Service;
28 use App\Services\ProjectServer; 33 use App\Services\ProjectServer;
29 use App\Services\SyncService; 34 use App\Services\SyncService;
30 use GuzzleHttp\Client; 35 use GuzzleHttp\Client;
@@ -48,7 +53,83 @@ class Demo extends Command @@ -48,7 +53,83 @@ class Demo extends Command
48 */ 53 */
49 protected $description = 'demo'; 54 protected $description = 'demo';
50 55
51 - public function handle(){ 56 + public function s(){
  57 + $projectModel = new Project();
  58 + $list = $projectModel->list(['id'=>181]);
  59 + foreach ($list as $v){
  60 + echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
  61 + ProjectServer::useProject($v['id']);
  62 + $this->initSearch($v['id']);
  63 + DB::disconnect('custom_mysql');
  64 + }
  65 + echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
  66 + }
  67 +
  68 + /**
  69 + * @remark :创建search页面
  70 + * @name :initSearch
  71 + * @author :lyh
  72 + * @method :post
  73 + * @time :2024/4/25 11:35
  74 + */
  75 + public function initSearch($project_id){
  76 + $bCustomTemplateModel = new BCustomTemplate();
  77 + $info = $bCustomTemplateModel->read(['url'=>'search']);
  78 + if($info === false){
  79 + $time = date('Y-m-d H:i:s');
  80 + $info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first();
  81 + if(empty($info)) {
  82 + $data = [
  83 + 'project_id' => $project_id,
  84 + 'name' => 'search',
  85 + 'status' => 1,
  86 + 'url' => 'search',
  87 + 'html' => '',
  88 + 'html_style' =>'search',
  89 + 'title' => 'search',
  90 + 'description' => 'Sorry. The page has either moved or cannot be found.',
  91 + 'created_at' => $time, 'updated_at' => $time];
  92 + $id = DB::connection('custom_mysql')->table('gl_web_custom_template')->insertGetId($data);
  93 + //路由
  94 + $info = DB::connection('custom_mysql')->table('gl_route_map')->first();
  95 + if(empty($info)) {
  96 + $data = ['project_id' => $project_id, 'source' => RouteMap::SOURCE_PAGE, 'source_id' => $id, 'route' => 'search', 'created_at' => $time, 'updated_at' => $time];
  97 + DB::connection('custom_mysql')->table('gl_route_map')->insert($data);
  98 + }
  99 + }
  100 + }
  101 + return true;
  102 + }
  103 +
  104 + /**
  105 + * Execute the job.
  106 + *
  107 + * @return void
  108 + */
  109 + public function handle()
  110 + {
  111 + $this->param['project_id'] = 181;
  112 + $imageModel = new ImageModel();
  113 + //获取当前项目的所有图片
  114 + $imageList = $imageModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos','size']);
  115 + if(!empty($imageList)){
  116 + $amazonS3Service = new AmazonS3Service();
  117 + foreach ($imageList as $k => $v){
  118 + $amazonS3Service->syncImageFiles(getImageUrl($v['path']));
  119 + $imageModel->edit(['is_cos'=>0],['id'=>$v['id']]);
  120 + }
  121 + }
52 122
  123 + $fileModel = new FileModel();
  124 + $fileList = $fileModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos','name']);
  125 + if(!empty($fileList)){
  126 + $amazonS3Service = new AmazonS3Service();
  127 + foreach ($fileList as $k => $v){
  128 + echo date('Y-m-d H:i:s') . '执行的数据id:' . $v['id'] . '名称:'.$v['name'] . PHP_EOL;
  129 + $amazonS3Service->syncImageFiles(getFileUrl($v['path']));
  130 + $fileModel->edit(['is_cos'=>0],['id'=>$v['id']]);
  131 + }
  132 + }
  133 + return true;
53 } 134 }
54 } 135 }
@@ -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 use App\Models\Project\Project; 5 use App\Models\Project\Project;
6 use App\Services\ProjectServer; 6 use App\Services\ProjectServer;
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;
@@ -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;
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;
@@ -46,7 +46,7 @@ class Kernel extends ConsoleKernel @@ -46,7 +46,7 @@ class Kernel extends ConsoleKernel
46 $schedule->command('update_keyword_route')->dailyAt('01:00')->withoutOverlapping(1); //升级项目--清除路由相同的关键字 46 $schedule->command('update_keyword_route')->dailyAt('01:00')->withoutOverlapping(1); //升级项目--清除路由相同的关键字
47 $schedule->command('recommended_suppliers')->dailyAt('03:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商 47 $schedule->command('recommended_suppliers')->dailyAt('03:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商
48 // 每日推送视频任务 48 // 每日推送视频任务
49 - $schedule->command('video_task')->dailyAt('02:30')->withoutOverlapping(1); 49 + $schedule->command('video_task')->hourly()->withoutOverlapping(1);
50 // 每日推送已完成视频任务项目生成对应界面 50 // 每日推送已完成视频任务项目生成对应界面
51 $schedule->command('notice_c')->dailyAt('04:00')->withoutOverlapping(1); 51 $schedule->command('notice_c')->dailyAt('04:00')->withoutOverlapping(1);
52 } 52 }
@@ -4,7 +4,9 @@ namespace App\Http\Controllers\Bside\FileManage; @@ -4,7 +4,9 @@ namespace App\Http\Controllers\Bside\FileManage;
4 4
5 5
6 use App\Enums\Common\Code; 6 use App\Enums\Common\Code;
  7 +use App\Helper\Translate;
7 use App\Http\Controllers\Bside\BaseController; 8 use App\Http\Controllers\Bside\BaseController;
  9 +use App\Models\File\File;
8 use App\Models\FileManage\FileManage; 10 use App\Models\FileManage\FileManage;
9 use App\Models\Project\Project; 11 use App\Models\Project\Project;
10 use App\Services\CosService; 12 use App\Services\CosService;
@@ -79,18 +81,14 @@ class FileManageController extends BaseController @@ -79,18 +81,14 @@ class FileManageController extends BaseController
79 'file.required'=>'请上传文件', 81 'file.required'=>'请上传文件',
80 ]); 82 ]);
81 $file = $request->file('file'); 83 $file = $request->file('file');
82 -  
83 $data = $this->checkFile($file); 84 $data = $this->checkFile($file);
84 -  
85 $path = '/file_manage/' . $this->user['project_id'] . '/' . date('Ymd'); 85 $path = '/file_manage/' . $this->user['project_id'] . '/' . date('Ymd');
86 - $fileName = uniqid().rand(10000,99999).'.'.$file->getClientOriginalExtension();  
87 - 86 + $name = $file->getClientOriginalName();
  87 + $fileName = $this->getOnlyFilename($name,$this->user['project_id']);
88 $cosService = new CosService(); 88 $cosService = new CosService();
89 $cosService->uploadFile($file,$path,$fileName); 89 $cosService->uploadFile($file,$path,$fileName);
90 -  
91 $data['project_id'] = $this->user['project_id']; 90 $data['project_id'] = $this->user['project_id'];
92 $data['path'] = $path.'/'.$fileName; 91 $data['path'] = $path.'/'.$fileName;
93 -  
94 $rs = $fileManage->add($data); 92 $rs = $fileManage->add($data);
95 if ($rs === false) { 93 if ($rs === false) {
96 $this->fail('上传失败'); 94 $this->fail('上传失败');
@@ -98,6 +96,41 @@ class FileManageController extends BaseController @@ -98,6 +96,41 @@ class FileManageController extends BaseController
98 $this->response('success'); 96 $this->response('success');
99 } 97 }
100 98
  99 + /**
  100 + * @remark :获取唯一名称
  101 + * @name :getOnlyFilename
  102 + * @author :lyh
  103 + * @method :post
  104 + * @time :2024/4/26 16:10
  105 + */
  106 + public function getOnlyFilename($name,$project_id = 0){
  107 + $nameArr = explode('.',$name);
  108 + $enName = generateRoute(Translate::tran($nameArr[0], 'en'));
  109 + $i=1;
  110 + while($this->onlyName($enName.'.'.$nameArr[1],$project_id)){
  111 + $enName = $enName .'-'.$i;
  112 + $i++;
  113 + }
  114 + return $enName.'.'.$nameArr[1];
  115 + }
  116 +
  117 + /**
  118 + * @remark :唯一名称
  119 + * @name :onlyName
  120 + * @author :lyh
  121 + * @method :post
  122 + * @time :2024/4/26 16:21
  123 + */
  124 + public function onlyName($enName,$project_id){
  125 + $fileModel = new FileManage();
  126 + $info = $fileModel->read(['project_id' => $project_id, 'en_name' => $enName]);
  127 + if($info !== false){
  128 + return true;
  129 + }
  130 + return false;
  131 + }
  132 +
  133 +
101 protected function checkFile($file){ 134 protected function checkFile($file){
102 $count = FileManage::where('project_id', $this->user['project_id'])->count(); 135 $count = FileManage::where('project_id', $this->user['project_id'])->count();
103 if($count >= $this->upload_config['upload_max_num']){ 136 if($count >= $this->upload_config['upload_max_num']){
@@ -27,6 +27,7 @@ use App\Models\User\User; @@ -27,6 +27,7 @@ use App\Models\User\User;
27 use App\Utils\EncryptUtils; 27 use App\Utils\EncryptUtils;
28 use http\Client\Response; 28 use http\Client\Response;
29 use Illuminate\Support\Facades\Cache; 29 use Illuminate\Support\Facades\Cache;
  30 +use Illuminate\Support\Facades\DB;
30 use Mrgoon\AliSms\AliSms; 31 use Mrgoon\AliSms\AliSms;
31 32
32 class LoginController extends BaseController 33 class LoginController extends BaseController
@@ -34,6 +34,7 @@ class CategoryController extends BaseController @@ -34,6 +34,7 @@ class CategoryController extends BaseController
34 { 34 {
35 $this->map = $this->searchParam(); 35 $this->map = $this->searchParam();
36 $filed = ['id', 'project_id', 'pid', 'title', 'image', 'route','keywords', 'describe', 'status','created_at','sort']; 36 $filed = ['id', 'project_id', 'pid', 'title', 'image', 'route','keywords', 'describe', 'status','created_at','sort'];
  37 + $this->map['deleted_at'] = null;
37 $list = $category->list($this->map,['sort','id'],$filed); 38 $list = $category->list($this->map,['sort','id'],$filed);
38 $data = []; 39 $data = [];
39 if(!empty($list)){ 40 if(!empty($list)){
@@ -35,6 +35,7 @@ class BTemplateLogController extends BaseController @@ -35,6 +35,7 @@ class BTemplateLogController extends BaseController
35 public function lists(BTemplateLog $bTemplateLog){ 35 public function lists(BTemplateLog $bTemplateLog){
36 // unset($this->map['template_id']); 36 // unset($this->map['template_id']);
37 $this->map['project_id'] = $this->user['project_id']; 37 $this->map['project_id'] = $this->user['project_id'];
  38 + $this->map['source'] = 1;
38 $this->map['is_custom'] = 0; 39 $this->map['is_custom'] = 0;
39 $lists = $bTemplateLog->lists($this->map,$this->page,$this->row,$this->order,['id','template_id','operator_id','source','created_at','updated_at']); 40 $lists = $bTemplateLog->lists($this->map,$this->page,$this->row,$this->order,['id','template_id','operator_id','source','created_at','updated_at']);
40 if(!empty($lists['list'])){ 41 if(!empty($lists['list'])){
@@ -8,6 +8,8 @@ use App\Http\Logic\Bside\BTemplate\CustomTemplateLogic; @@ -8,6 +8,8 @@ use App\Http\Logic\Bside\BTemplate\CustomTemplateLogic;
8 use App\Http\Requests\Bside\Template\CustomTemplateRequest; 8 use App\Http\Requests\Bside\Template\CustomTemplateRequest;
9 use App\Models\Template\BTemplate; 9 use App\Models\Template\BTemplate;
10 use App\Models\Template\BTemplateLog; 10 use App\Models\Template\BTemplateLog;
  11 +use App\Models\Template\Template;
  12 +use App\Models\User\User;
11 13
12 /** 14 /**
13 * @remark :自定义模块 15 * @remark :自定义模块
@@ -123,9 +125,18 @@ class CustomTemplateController extends BaseController @@ -123,9 +125,18 @@ class CustomTemplateController extends BaseController
123 ],[ 125 ],[
124 'source_id.required' => 'ID不能为空', 126 'source_id.required' => 'ID不能为空',
125 ]); 127 ]);
126 - $this->map['source'] = 9;  
127 - $this->map['is_custom'] = 0;  
128 - $lists = $bTemplateLog->lists($this->map,$this->page,$this->row); 128 + $lists = $bTemplateLog->list(['source'=>9,'is_custom'=>0,'source_id'=>$this->param['source_id']],'id',['id','template_id','operator_id','source','created_at','updated_at'],'desc',10);
  129 + if(!empty($lists)){
  130 + $templateModel = new Template();
  131 + $userModel = new User();
  132 + foreach ($lists as $k => $v){
  133 + if(!empty($v['template_id'])){
  134 + $v['template_name'] = $templateModel->read(['id'=>$v['template_id']],['name'])['name'];
  135 + }
  136 + $v['operator_name'] = $userModel->getName($v['operator_id']);
  137 + $lists[$k] = $v;
  138 + }
  139 + }
129 $this->response('success',Code::SUCCESS,$lists); 140 $this->response('success',Code::SUCCESS,$lists);
130 } 141 }
131 142
@@ -140,7 +151,7 @@ class CustomTemplateController extends BaseController @@ -140,7 +151,7 @@ class CustomTemplateController extends BaseController
140 $this->request->validate([ 151 $this->request->validate([
141 'id'=>['required'], 152 'id'=>['required'],
142 ],[ 153 ],[
143 - 'id.required' => '模版ID不能为空', 154 + 'id.required' => 'ID不能为空',
144 ]); 155 ]);
145 $logic->saveRollbackVersion(); 156 $logic->saveRollbackVersion();
146 $this->response('success'); 157 $this->response('success');
@@ -3,8 +3,10 @@ @@ -3,8 +3,10 @@
3 namespace App\Http\Controllers\File; 3 namespace App\Http\Controllers\File;
4 4
5 use App\Enums\Common\Code; 5 use App\Enums\Common\Code;
  6 +use App\Helper\Translate;
6 use App\Models\File\ErrorFile; 7 use App\Models\File\ErrorFile;
7 use App\Models\File\File; 8 use App\Models\File\File;
  9 +use App\Models\File\Image as ImageModel;
8 use App\Models\Project\Project; 10 use App\Models\Project\Project;
9 use App\Services\AmazonS3Service; 11 use App\Services\AmazonS3Service;
10 use App\Services\CosService; 12 use App\Services\CosService;
@@ -120,7 +122,7 @@ class FileController @@ -120,7 +122,7 @@ class FileController
120 if($file_hash !== false){ 122 if($file_hash !== false){
121 return $this->response('资源',Code::SUCCESS,$this->responseData($file_hash['path'], $name)); 123 return $this->response('资源',Code::SUCCESS,$this->responseData($file_hash['path'], $name));
122 } 124 }
123 - $fileName = uniqid().rand(10000,99999).'.'.$files->getClientOriginalExtension(); 125 + $fileName = $this->getOnlyFilename($name,$param['project_id'] ?? 0);
124 //同步数据到cos 126 //同步数据到cos
125 if($this->upload_location == 0){ 127 if($this->upload_location == 0){
126 $cosService = new CosService(); 128 $cosService = new CosService();
@@ -155,6 +157,40 @@ class FileController @@ -155,6 +157,40 @@ class FileController
155 } 157 }
156 158
157 /** 159 /**
  160 + * @remark :获取唯一名称
  161 + * @name :getOnlyFilename
  162 + * @author :lyh
  163 + * @method :post
  164 + * @time :2024/4/26 16:10
  165 + */
  166 + public function getOnlyFilename($name,$project_id = 0){
  167 + $nameArr = explode('.',$name);
  168 + $enName = generateRoute(Translate::tran($nameArr[0], 'en'));
  169 + $i=1;
  170 + while($this->onlyName($enName.'.'.$nameArr[1],$project_id)){
  171 + $enName = $enName .'-'.$i;
  172 + $i++;
  173 + }
  174 + return $enName.'.'.$nameArr[1];
  175 + }
  176 +
  177 + /**
  178 + * @remark :唯一名称
  179 + * @name :onlyName
  180 + * @author :lyh
  181 + * @method :post
  182 + * @time :2024/4/26 16:21
  183 + */
  184 + public function onlyName($enName,$project_id){
  185 + $fileModel = new File();
  186 + $info = $fileModel->read(['project_id' => $project_id, 'en_name' => $enName]);
  187 + if($info !== false){
  188 + return true;
  189 + }
  190 + return false;
  191 + }
  192 +
  193 + /**
158 * 接口上传单文件 194 * 接口上传单文件
159 * @param $files 195 * @param $files
160 * @return array 196 * @return array
@@ -222,6 +258,7 @@ class FileController @@ -222,6 +258,7 @@ class FileController
222 'mime'=>$mime, 258 'mime'=>$mime,
223 'project_id'=>$this->cache['project_id'] ?? 0, 259 'project_id'=>$this->cache['project_id'] ?? 0,
224 'name'=>$name, 260 'name'=>$name,
  261 + 'en_name'=>$fileName
225 ]; 262 ];
226 $rs = $fileModel->add($data); 263 $rs = $fileModel->add($data);
227 if ($rs === false) { 264 if ($rs === false) {
@@ -254,7 +291,7 @@ class FileController @@ -254,7 +291,7 @@ class FileController
254 } 291 }
255 $url = $this->config['root'].'/'.$this->path; 292 $url = $this->config['root'].'/'.$this->path;
256 $file_type = $file->getClientOriginalExtension(); 293 $file_type = $file->getClientOriginalExtension();
257 - $fileName = uniqid().rand(10000,99999).'.'.$file_type; 294 + $fileName = $this->getOnlyFilename($name,$param['project_id'] ?? 0);
258 //同步数据到cos 295 //同步数据到cos
259 if($this->upload_location == 0){ 296 if($this->upload_location == 0){
260 $cosService = new CosService(); 297 $cosService = new CosService();
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 namespace App\Http\Controllers\File; 3 namespace App\Http\Controllers\File;
4 4
5 use App\Enums\Common\Code; 5 use App\Enums\Common\Code;
  6 +use App\Helper\Translate;
6 use App\Http\Controllers\Controller; 7 use App\Http\Controllers\Controller;
7 use App\Http\Controllers\type; 8 use App\Http\Controllers\type;
8 use App\Models\File\ErrorFile; 9 use App\Models\File\ErrorFile;
@@ -200,7 +201,7 @@ class ImageController extends Controller @@ -200,7 +201,7 @@ class ImageController extends Controller
200 if(strlen($image_type) > 7){ 201 if(strlen($image_type) > 7){
201 $this->response('不支持当前格式',Code::SYSTEM_ERROR); 202 $this->response('不支持当前格式',Code::SYSTEM_ERROR);
202 } 203 }
203 - $fileName = uniqid().rand(10000,99999).'.'.$image_type; 204 + $fileName = $this->getOnlyFilename($name,$param['project_id'] ?? 0);
204 //上传到cos 205 //上传到cos
205 if($this->upload_location == 0){ 206 if($this->upload_location == 0){
206 $cosService = new CosService(); 207 $cosService = new CosService();
@@ -216,6 +217,41 @@ class ImageController extends Controller @@ -216,6 +217,41 @@ class ImageController extends Controller
216 } 217 }
217 218
218 /** 219 /**
  220 + * @remark :获取唯一名称
  221 + * @name :getOnlyFilename
  222 + * @author :lyh
  223 + * @method :post
  224 + * @time :2024/4/26 16:10
  225 + */
  226 + public function getOnlyFilename($name,$project_id = 0){
  227 + $nameArr = explode('.',$name);
  228 + $enName = generateRoute(Translate::tran($nameArr[0], 'en'));
  229 + $i=1;
  230 + while($this->onlyName($enName.'.'.$nameArr[1],$project_id)){
  231 + $enName = $enName .'-'.$i;
  232 + $i++;
  233 + }
  234 + return $enName.'.'.$nameArr[1];
  235 + }
  236 +
  237 + /**
  238 + * @remark :唯一名称
  239 + * @name :onlyName
  240 + * @author :lyh
  241 + * @method :post
  242 + * @time :2024/4/26 16:21
  243 + */
  244 + public function onlyName($enName,$project_id){
  245 + $imageModel = new ImageModel();
  246 + $info = $imageModel->read(['project_id' => $project_id, 'en_name' => $enName]);
  247 + if($info !== false){
  248 + return true;
  249 + }
  250 + return false;
  251 + }
  252 +
  253 +
  254 + /**
219 * @remark :指定同步文件到獨立177服務器 255 * @remark :指定同步文件到獨立177服務器
220 * @name :synchronizationFile 256 * @name :synchronizationFile
221 * @author :lyh 257 * @author :lyh
@@ -253,6 +289,7 @@ class ImageController extends Controller @@ -253,6 +289,7 @@ class ImageController extends Controller
253 'mime'=>$mime, 289 'mime'=>$mime,
254 'project_id'=>$this->cache['project_id'] ?? 0, 290 'project_id'=>$this->cache['project_id'] ?? 0,
255 'name'=>$name, 291 'name'=>$name,
  292 + 'en_name'=>$fileName
256 ]; 293 ];
257 $rs = $imageModel->add($data); 294 $rs = $imageModel->add($data);
258 if ($rs === false) { 295 if ($rs === false) {
@@ -299,7 +336,7 @@ class ImageController extends Controller @@ -299,7 +336,7 @@ class ImageController extends Controller
299 continue; 336 continue;
300 } 337 }
301 $image_type = $file->getClientOriginalExtension(); 338 $image_type = $file->getClientOriginalExtension();
302 - $fileName = uniqid().rand(10000,99999).'.'.$image_type; 339 + $fileName = $this->getOnlyFilename($name,$param['project_id'] ?? 0);
303 //同步数据到cos 340 //同步数据到cos
304 if($this->upload_location == 0){ 341 if($this->upload_location == 0){
305 $cosService = new CosService(); 342 $cosService = new CosService();
@@ -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
@@ -111,12 +111,12 @@ class CustomTemplateLogic extends BaseLogic @@ -111,12 +111,12 @@ class CustomTemplateLogic extends BaseLogic
111 $this->saveCommonTemplate($html,$bSettingInfo['template_id']); 111 $this->saveCommonTemplate($html,$bSettingInfo['template_id']);
112 $this->param['html'] = characterTruncation($html,'/<main\b[^>]*>(.*?)<\/main>/s'); 112 $this->param['html'] = characterTruncation($html,'/<main\b[^>]*>(.*?)<\/main>/s');
113 $this->param['html_style'] = characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s'); 113 $this->param['html_style'] = characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s');
114 - $this->setTemplateLog($bSettingInfo['template_id'],$html,$this->param['id']);  
115 } 114 }
116 $rs = $this->model->edit($this->param,['id'=>$this->param['id'],'project_id'=>$this->user['project_id']]); 115 $rs = $this->model->edit($this->param,['id'=>$this->param['id'],'project_id'=>$this->user['project_id']]);
117 if($rs === false){ 116 if($rs === false){
118 $this->fail('系统错误,请联系管理'); 117 $this->fail('系统错误,请联系管理');
119 } 118 }
  119 + $this->setTemplateLog($bSettingInfo['template_id'],$html,$this->param['id']);
120 //通知 120 //通知
121 $this->addUpdateNotify(RouteMap::SOURCE_PAGE,$info['url']); 121 $this->addUpdateNotify(RouteMap::SOURCE_PAGE,$info['url']);
122 $this->curlDelRoute(['route'=>$info['url'],'new_route'=>$info['url']]); 122 $this->curlDelRoute(['route'=>$info['url'],'new_route'=>$info['url']]);
@@ -386,15 +386,16 @@ class CustomTemplateLogic extends BaseLogic @@ -386,15 +386,16 @@ 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']]);
  394 + $this->model->edit(['html'=>$logInfo['main_html'],'html_style'=>$logInfo['main_css']],['id'=>$logInfo['source_id']]);
  395 + }else{
  396 + $this->model->edit(['html'=>$logInfo['text']],['id'=>$logInfo['source_id']]);
396 } 397 }
397 - $this->model->edit(['html'=>$logInfo['main_html'],'html_style'=>$logInfo['main_css']],['id'=>$logInfo['source_id']]); 398 +
398 return $this->success(); 399 return $this->success();
399 } 400 }
400 } 401 }
@@ -174,7 +174,7 @@ class BaseLogic extends Logic @@ -174,7 +174,7 @@ class BaseLogic extends Logic
174 $data['project_id'] = $this->user['project_id']; 174 $data['project_id'] = $this->user['project_id'];
175 $str = http_build_query($data); 175 $str = http_build_query($data);
176 $url = $this->user['domain'].'api/delHtml/?'.$str; 176 $url = $this->user['domain'].'api/delHtml/?'.$str;
177 - if(isset($this->project['serve_id']) && ($this->project['serve_id'] == 3)){//TODO::当前项目通知不过 ,跳过自动更新 177 + if(isset($this->project['serve_id']) && ($this->project['serve_id'] != 1)){//TODO::当前项目通知不过 ,跳过自动更新
178 exec('curl -k "'.$url.'" > /dev/null 2>&1 &'); 178 exec('curl -k "'.$url.'" > /dev/null 2>&1 &');
179 }else{ 179 }else{
180 shell_exec('curl -k "'.$url.'"'); 180 shell_exec('curl -k "'.$url.'"');
@@ -39,21 +39,23 @@ class CopyImageFileJob implements ShouldQueue @@ -39,21 +39,23 @@ class CopyImageFileJob implements ShouldQueue
39 { 39 {
40 $imageModel = new ImageModel(); 40 $imageModel = new ImageModel();
41 //获取当前项目的所有图片 41 //获取当前项目的所有图片
42 - $imageList = $imageModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos','size']); 42 + $imageList = $imageModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos','size','name']);
43 if(!empty($imageList)){ 43 if(!empty($imageList)){
44 $amazonS3Service = new AmazonS3Service(); 44 $amazonS3Service = new AmazonS3Service();
45 foreach ($imageList as $k => $v){ 45 foreach ($imageList as $k => $v){
  46 + echo date('Y-m-d H:i:s') . '执行图片的数据id:' . $v['id'] . '名称:'.$v['name'] . PHP_EOL;
46 $amazonS3Service->syncImageFiles(getImageUrl($v['path'])); 47 $amazonS3Service->syncImageFiles(getImageUrl($v['path']));
47 $imageModel->edit(['is_cos'=>0],['id'=>$v['id']]); 48 $imageModel->edit(['is_cos'=>0],['id'=>$v['id']]);
48 } 49 }
49 } 50 }
50 51
51 $fileModel = new FileModel(); 52 $fileModel = new FileModel();
52 - $fileList = $fileModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos']); 53 + $fileList = $fileModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos','name']);
53 if(!empty($fileList)){ 54 if(!empty($fileList)){
54 $amazonS3Service = new AmazonS3Service(); 55 $amazonS3Service = new AmazonS3Service();
55 foreach ($fileList as $k => $v){ 56 foreach ($fileList as $k => $v){
56 - $amazonS3Service->syncImageFiles(getImageUrl($v['path'])); 57 + echo date('Y-m-d H:i:s') . '执行文件的数据id:' . $v['id'] . '名称:'.$v['name'] . PHP_EOL;
  58 + $amazonS3Service->syncImageFiles(getFileUrl($v['path']));
57 $fileModel->edit(['is_cos'=>0],['id'=>$v['id']]); 59 $fileModel->edit(['is_cos'=>0],['id'=>$v['id']]);
58 } 60 }
59 } 61 }
@@ -16,6 +16,7 @@ class KeywordVideoTaskLog extends Base @@ -16,6 +16,7 @@ class KeywordVideoTaskLog extends Base
16 const STATUS_INIT = 0; 16 const STATUS_INIT = 0;
17 const STATUS_RUNNING = 1; 17 const STATUS_RUNNING = 1;
18 const STATUS_FINISH = 2; 18 const STATUS_FINISH = 2;
  19 + const STATUS_ERROR = 3;
19 20
20 protected $table = 'gl_keyword_video_task_log'; 21 protected $table = 'gl_keyword_video_task_log';
21 } 22 }
@@ -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 }