正在显示
1 个修改的文件
包含
1 行增加
和
9 行删除
| @@ -35,17 +35,11 @@ class SyncTimeFiles extends Command | @@ -35,17 +35,11 @@ class SyncTimeFiles extends Command | ||
| 35 | $imagesModel = new Image(); | 35 | $imagesModel = new Image(); |
| 36 | $start = '2025-10-1 00:00:00'; | 36 | $start = '2025-10-1 00:00:00'; |
| 37 | $end = '2025-10-31 23:59:59'; | 37 | $end = '2025-10-31 23:59:59'; |
| 38 | - $lists = $imagesModel->list(['created_at'=>['between',[$start,$end]]]); | 38 | + $lists = $imagesModel->list(['created_at'=>['between',[$start,$end]]],'id',['path'],'asc'); |
| 39 | foreach ($lists as $v){ | 39 | foreach ($lists as $v){ |
| 40 | $path = $v['path']; | 40 | $path = $v['path']; |
| 41 | echo date('Y-m-d H:i:s') . ' | 图片链接:' . $path . PHP_EOL; | 41 | echo date('Y-m-d H:i:s') . ' | 图片链接:' . $path . PHP_EOL; |
| 42 | $code = $this->synchronizationFile($path); | 42 | $code = $this->synchronizationFile($path); |
| 43 | - dd($code); | ||
| 44 | - if(200 != (int)$code){ | ||
| 45 | - echo date('Y-m-d H:i:s') . ' | 错误状态:' . $code . PHP_EOL; | ||
| 46 | - $errorFileModel = new ErrorFile(); | ||
| 47 | - $errorFileModel->add(['path'=>$this->param['path'].'/'.$this->param['name']]); | ||
| 48 | - } | ||
| 49 | echo date('Y-m-d H:i:s') . ' | ok:' . $code . PHP_EOL; | 43 | echo date('Y-m-d H:i:s') . ' | ok:' . $code . PHP_EOL; |
| 50 | } | 44 | } |
| 51 | return true; | 45 | return true; |
| @@ -53,8 +47,6 @@ class SyncTimeFiles extends Command | @@ -53,8 +47,6 @@ class SyncTimeFiles extends Command | ||
| 53 | 47 | ||
| 54 | public function synchronizationFile($path_name){ | 48 | public function synchronizationFile($path_name){ |
| 55 | //同步到大文件 | 49 | //同步到大文件 |
| 56 | -// $file_path = config('filesystems.disks.cos')['cdn1'].$path_name; | ||
| 57 | -// $directoryPath = pathinfo($path_name, PATHINFO_DIRNAME); | ||
| 58 | $cmd = 'curl -k -F "file_path='.$path_name.'" -F "save_path=/www/wwwroot/cos'.$path_name.'" https://v6-file.globalso.com/upload.php'; | 50 | $cmd = 'curl -k -F "file_path='.$path_name.'" -F "save_path=/www/wwwroot/cos'.$path_name.'" https://v6-file.globalso.com/upload.php'; |
| 59 | return shell_exec($cmd); | 51 | return shell_exec($cmd); |
| 60 | } | 52 | } |
-
请 注册 或 登录 后发表评论