作者 李宇航

合并分支 'lyh-server' 到 'master'

Lyh server



查看合并请求 !3119
... ... @@ -38,12 +38,11 @@ class SyncFile extends Command
}else{
$code = $this->synchronizationFile($v['path']);
}
echo date('Y-m-d H:i:s') . 'code:'. $code . PHP_EOL;
if((int)$code == 200){
echo date('Y-m-d H:i:s') . '编辑的path为:'. $v['path'] .',主键id:'. $v['id'] . PHP_EOL;
$errorFileModel->edit(['status'=>1],['id'=>$v['id']]);
}
// echo date('Y-m-d H:i:s') . 'code:'. $code . PHP_EOL;
// if((int)$code == 200){
// echo date('Y-m-d H:i:s') . '编辑的path为:'. $v['path'] .',主键id:'. $v['id'] . PHP_EOL;
// $errorFileModel->edit(['status'=>1],['id'=>$v['id']]);
// }
}
echo date('Y-m-d H:i:s') . '编辑的end为:' . PHP_EOL;
return true;
... ...
... ... @@ -40,9 +40,9 @@ class SyncProjectFile extends Command
}else{
$code = $this->synchronizationFile($v['path']);
}
if((int)$code == 200){
// if((int)$code == 200){
echo date('Y-m-d H:i:s') . '编辑的path为:'. $v['path'] .',主键id:'. $v['id'] . PHP_EOL;
}
// }
}
echo date('Y-m-d H:i:s') . '编辑的end为:' . PHP_EOL;
return true;
... ...
... ... @@ -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);
}
... ...
... ... @@ -52,11 +52,6 @@ class SyncTimeMinuteFile extends Command
// continue;
// }
$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;
... ...
... ... @@ -32,11 +32,6 @@ class SyncVideo extends Command
$path = $this->argument('path');
$code = $this->synchronizationFile($path);
echo date('Y-m-d H:i:s') . ' | ' . $code . PHP_EOL;
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']]);
}
return true;
}
... ...