|
...
|
...
|
@@ -35,16 +35,11 @@ class SyncTimeFiles extends Command |
|
|
|
$imagesModel = new Image();
|
|
|
|
$start = '2025-10-1 00:00:00';
|
|
|
|
$end = '2025-10-31 23:59:59';
|
|
|
|
$lists = $imagesModel->list(['created_at'=>['between',[$start,$end]]]);
|
|
|
|
$lists = $imagesModel->list(['created_at'=>['between',[$start,$end]]],'id',['path'],'asc');
|
|
|
|
foreach ($lists as $v){
|
|
|
|
$path = $v['path'];
|
|
|
|
echo date('Y-m-d H:i:s') . ' | 图片链接:' . $path . PHP_EOL;
|
|
|
|
$code = $this->synchronizationFile($path);
|
|
|
|
if(200 != (int)$code){
|
|
|
|
echo date('Y-m-d H:i:s') . ' | 错误状态:' . $code . PHP_EOL;
|
|
|
|
$errorFileModel = new ErrorFile();
|
|
|
|
$errorFileModel->add(['path'=>$this->param['path'].'/'.$this->param['name']]);
|
|
|
|
}
|
|
|
|
echo date('Y-m-d H:i:s') . ' | ok:' . $code . PHP_EOL;
|
|
|
|
}
|
|
|
|
return true;
|
|
...
|
...
|
@@ -52,8 +47,6 @@ class SyncTimeFiles extends Command |
|
|
|
|
|
|
|
public function synchronizationFile($path_name){
|
|
|
|
//同步到大文件
|
|
|
|
// $file_path = config('filesystems.disks.cos')['cdn1'].$path_name;
|
|
|
|
// $directoryPath = pathinfo($path_name, PATHINFO_DIRNAME);
|
|
|
|
$cmd = 'curl -k -F "file_path='.$path_name.'" -F "save_path=/www/wwwroot/cos'.$path_name.'" https://v6-file.globalso.com/upload.php';
|
|
|
|
return shell_exec($cmd);
|
|
|
|
}
|
...
|
...
|
|