|
@@ -33,11 +33,16 @@ class SyncFile extends Command |
|
@@ -33,11 +33,16 @@ class SyncFile extends Command |
|
33
|
$errorFileModel = new ErrorFile();
|
33
|
$errorFileModel = new ErrorFile();
|
|
34
|
$lists = $errorFileModel->list(['status'=>0]);//未同步成功的图片及文件
|
34
|
$lists = $errorFileModel->list(['status'=>0]);//未同步成功的图片及文件
|
|
35
|
foreach ($lists as $k => $v){
|
35
|
foreach ($lists as $k => $v){
|
|
36
|
- $code = $this->synchronizationFile($v['path']);
|
36
|
+ if(strpos($v['path'], '181') !== false ){
|
|
|
|
37
|
+ $code = $this->synchronizationFiles($v['path']);
|
|
|
|
38
|
+ }else{
|
|
|
|
39
|
+ $code = $this->synchronizationFile($v['path']);
|
|
|
|
40
|
+ }
|
|
37
|
if((int)$code == 200){
|
41
|
if((int)$code == 200){
|
|
38
|
echo date('Y-m-d H:i:s') . '编辑的path为:'. $v['path'] .',主键id:'. $v['id'] . PHP_EOL;
|
42
|
echo date('Y-m-d H:i:s') . '编辑的path为:'. $v['path'] .',主键id:'. $v['id'] . PHP_EOL;
|
|
39
|
$errorFileModel->edit(['status'=>1],['id'=>$v['id']]);
|
43
|
$errorFileModel->edit(['status'=>1],['id'=>$v['id']]);
|
|
40
|
}
|
44
|
}
|
|
|
|
45
|
+
|
|
41
|
}
|
46
|
}
|
|
42
|
echo date('Y-m-d H:i:s') . '编辑的end为:' . PHP_EOL;
|
47
|
echo date('Y-m-d H:i:s') . '编辑的end为:' . PHP_EOL;
|
|
43
|
return true;
|
48
|
return true;
|
|
@@ -57,4 +62,13 @@ class SyncFile extends Command |
|
@@ -57,4 +62,13 @@ class SyncFile extends Command |
|
57
|
$cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php';
|
62
|
$cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php';
|
|
58
|
return shell_exec($cmd);
|
63
|
return shell_exec($cmd);
|
|
59
|
}
|
64
|
}
|
|
|
|
65
|
+
|
|
|
|
66
|
+
|
|
|
|
67
|
+ public function synchronizationFiles($path_name){
|
|
|
|
68
|
+ //同步到大文件
|
|
|
|
69
|
+ $file_path = config('filesystems.disks.s3')['cdn'].$path_name;
|
|
|
|
70
|
+ $directoryPath = pathinfo($path_name, PATHINFO_DIRNAME);
|
|
|
|
71
|
+ $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php';
|
|
|
|
72
|
+ return shell_exec($cmd);
|
|
|
|
73
|
+ }
|
|
60
|
} |
74
|
} |