Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate
正在显示
2 个修改的文件
包含
10 行增加
和
53 行删除
| @@ -11,6 +11,7 @@ use App\Helper\Common; | @@ -11,6 +11,7 @@ use App\Helper\Common; | ||
| 11 | use App\Models\Blog\Blog; | 11 | 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\Image; | 15 | use App\Models\File\Image; |
| 15 | use App\Models\Manage\BelongingGroup; | 16 | use App\Models\Manage\BelongingGroup; |
| 16 | use App\Models\Manage\Dept; | 17 | use App\Models\Manage\Dept; |
| @@ -265,56 +266,12 @@ class Demo extends Command | @@ -265,56 +266,12 @@ class Demo extends Command | ||
| 265 | // print_r($include); | 266 | // print_r($include); |
| 266 | // } | 267 | // } |
| 267 | public function handle(){ | 268 | public function handle(){ |
| 268 | - $domainModel = new DomainInfo(); | ||
| 269 | - $domainInfo = $domainModel->read(['project_id'=>45]); | ||
| 270 | - if($domainInfo === false){ | ||
| 271 | - dd('11111'); | ||
| 272 | - } | ||
| 273 | - $bg = ''; | ||
| 274 | - $logo = ''; | ||
| 275 | - $dom = file_get_html('https://'.$domainInfo['domain'].'/'); | ||
| 276 | - $logoDom = $dom->find('.logo', 0)->find("img",0); | ||
| 277 | - if($logoDom != null){ | ||
| 278 | - $logo = $logoDom->src; | ||
| 279 | - } | ||
| 280 | - $elements = $dom->find('.section-banner-wrap-block'); | ||
| 281 | - if (count($elements) >= 2) { | ||
| 282 | - foreach ($elements as $v){ | ||
| 283 | - $image = $v->find('img', 0); | ||
| 284 | - if($image != null){ | ||
| 285 | - break; | ||
| 286 | - } | ||
| 287 | - } | ||
| 288 | - } else { | ||
| 289 | - $image = $elements->find('img', 0); | ||
| 290 | - } | ||
| 291 | - if($image != null){ | ||
| 292 | - $bg = $image->src; | 269 | + $fileModel = new File(); |
| 270 | + $lists = $fileModel->list(['created_at'=>['>=','2024-04-12 00:00:00']]); | ||
| 271 | + foreach ($lists as $k=> $v){ | ||
| 272 | + $str = './coscli cp cos://globalso-v6-1309677403'.$v['path'].' /home/cos/'.$v['path']; | ||
| 273 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($str, true) . PHP_EOL, FILE_APPEND); | ||
| 293 | } | 274 | } |
| 294 | - if($image != null){ | ||
| 295 | - $bg = $image->src; | ||
| 296 | - } | ||
| 297 | -// return $logo; | ||
| 298 | - dd(['logo'=>$logo ?? '','bg'=>$bg ?? '']); | ||
| 299 | -// $projectModel = new Project(); | ||
| 300 | -// $list = $projectModel->list(['delete_status'=>0,'type'=>['!=',0]]); | ||
| 301 | -// foreach ($list as $v1){ | ||
| 302 | -// ProjectServer::useProject($v1['id']); | ||
| 303 | -// echo date('Y-m-d H:i:s') . '项目id:'.$v1['id'] . PHP_EOL; | ||
| 304 | -// $navGroupModel = new BNavGroup(); | ||
| 305 | -// $groupList = $navGroupModel->list(['sort_list'=>['!=','']]); | ||
| 306 | -// if(empty($groupList)){ | ||
| 307 | -// continue; | ||
| 308 | -// } | ||
| 309 | -// foreach ($groupList as $k=>$v){ | ||
| 310 | -// if(!empty($v['sort_list'])){ | ||
| 311 | -// $sort_list = json_decode($v['sort_list']); | ||
| 312 | -// $sort = 0; | ||
| 313 | -// $this->subSort($sort_list,$sort); | ||
| 314 | -// } | ||
| 315 | -// } | ||
| 316 | -// DB::disconnect('custom_mysql'); | ||
| 317 | -// } | ||
| 318 | return true; | 275 | return true; |
| 319 | } | 276 | } |
| 320 | 277 |
| @@ -130,7 +130,7 @@ class FileController | @@ -130,7 +130,7 @@ class FileController | ||
| 130 | $amazonS3Service->uploadFiles($files,$this->path,$fileName); | 130 | $amazonS3Service->uploadFiles($files,$this->path,$fileName); |
| 131 | } | 131 | } |
| 132 | $this->saveMysql($fileModel,$files->getSize(),$files->getClientOriginalExtension(),$fileName,$hash,$this->upload_location,$files->getMimeType(),$name); | 132 | $this->saveMysql($fileModel,$files->getSize(),$files->getClientOriginalExtension(),$fileName,$hash,$this->upload_location,$files->getMimeType(),$name); |
| 133 | - $this->synchronizationFile($files->getClientOriginalExtension(),$fileName); | 133 | + $this->synchronizationFile($fileName); |
| 134 | $this->response('资源',Code::SUCCESS,$this->responseData($this->path.'/'.$fileName, $name)); | 134 | $this->response('资源',Code::SUCCESS,$this->responseData($this->path.'/'.$fileName, $name)); |
| 135 | } | 135 | } |
| 136 | 136 | ||
| @@ -141,9 +141,9 @@ class FileController | @@ -141,9 +141,9 @@ class FileController | ||
| 141 | * @method :post | 141 | * @method :post |
| 142 | * @time :2024/4/8 11:10 | 142 | * @time :2024/4/8 11:10 |
| 143 | */ | 143 | */ |
| 144 | - public function synchronizationFile($file_type,$fileName){ | 144 | + public function synchronizationFile($fileName){ |
| 145 | //同步到大文件 | 145 | //同步到大文件 |
| 146 | - $file_path = getFileUrl($this->path.'/'.$fileName,$this->cache['storage_type'] ?? 0); | 146 | + $file_path = config('filesystems.disks.cos')['cdn1'].$this->path.'/'.$fileName; |
| 147 | $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->path.'" https://v6-file.globalso.com/upload.php'; | 147 | $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->path.'" https://v6-file.globalso.com/upload.php'; |
| 148 | shell_exec($cmd); | 148 | shell_exec($cmd); |
| 149 | } | 149 | } |
| @@ -262,7 +262,7 @@ class FileController | @@ -262,7 +262,7 @@ class FileController | ||
| 262 | $mime = $file->getMimeType(); | 262 | $mime = $file->getMimeType(); |
| 263 | $this->saveMysql($fileModel,$size,$file_type,$fileName,$hash,$this->upload_location,$mime,$name); | 263 | $this->saveMysql($fileModel,$size,$file_type,$fileName,$hash,$this->upload_location,$mime,$name); |
| 264 | $data[] = $this->responseData($this->path.'/'.$fileName, $name); | 264 | $data[] = $this->responseData($this->path.'/'.$fileName, $name); |
| 265 | - $this->synchronizationFile($file_type,$fileName); | 265 | + $this->synchronizationFile($fileName); |
| 266 | } | 266 | } |
| 267 | $this->response('资源',Code::SUCCESS,$data); | 267 | $this->response('资源',Code::SUCCESS,$data); |
| 268 | } | 268 | } |
-
请 注册 或 登录 后发表评论