作者 李宇航

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

Lyh server



查看合并请求 !2662
@@ -32,8 +32,8 @@ class SyncTimeFiles extends Command @@ -32,8 +32,8 @@ class SyncTimeFiles extends Command
32 { 32 {
33 $fileModel = new File(); 33 $fileModel = new File();
34 // $imagesModel = new Image(); 34 // $imagesModel = new Image();
35 - $start = '2024-11-07 15:00:00';  
36 - $end = '2024-11-07 15:25:00'; 35 + $start = '2025-08-28 00:00:00';
  36 + $end = '2025-08-28 23:00:00';
37 $lists = $fileModel->list(['created_at'=>['between',[$start,$end]]]); 37 $lists = $fileModel->list(['created_at'=>['between',[$start,$end]]]);
38 foreach ($lists as $v){ 38 foreach ($lists as $v){
39 $path = $v['path']; 39 $path = $v['path'];
@@ -47,10 +47,10 @@ class SyncTimeMinuteFile extends Command @@ -47,10 +47,10 @@ class SyncTimeMinuteFile extends Command
47 } 47 }
48 foreach ($lists as $v){ 48 foreach ($lists as $v){
49 $path = $v['path']; 49 $path = $v['path'];
50 - if (file_exists($dir.$path)) {  
51 - echo date('Y-m-d H:i:s') . ' | file_ok:' . $dir.$path . PHP_EOL;  
52 - continue;  
53 - } 50 +// if (file_exists($dir.$path)) {
  51 +// echo date('Y-m-d H:i:s') . ' | file_ok:' . $dir.$path . PHP_EOL;
  52 +// continue;
  53 +// }
54 $code = $this->synchronizationFile($path); 54 $code = $this->synchronizationFile($path);
55 if(200 != (int)$code){ 55 if(200 != (int)$code){
56 echo date('Y-m-d H:i:s') . ' | 错误状态:' . $code . PHP_EOL; 56 echo date('Y-m-d H:i:s') . ' | 错误状态:' . $code . PHP_EOL;
@@ -132,7 +132,7 @@ class FileController @@ -132,7 +132,7 @@ class FileController
132 $amazonS3Service->uploadFiles($files,$this->path,$fileName); 132 $amazonS3Service->uploadFiles($files,$this->path,$fileName);
133 } 133 }
134 $this->saveMysql($fileModel,$files->getSize(),$files->getClientOriginalExtension(),$fileName,$hash,$this->upload_location,$files->getMimeType(),$name); 134 $this->saveMysql($fileModel,$files->getSize(),$files->getClientOriginalExtension(),$fileName,$hash,$this->upload_location,$files->getMimeType(),$name);
135 -// $this->synchronizationFile($fileName,$this->upload_location); 135 + $this->synchronizationFile($fileName,$this->upload_location);
136 $this->response('资源',Code::SUCCESS,$this->responseData($this->path.'/'.$fileName, $name)); 136 $this->response('资源',Code::SUCCESS,$this->responseData($this->path.'/'.$fileName, $name));
137 } 137 }
138 138
@@ -306,7 +306,7 @@ class FileController @@ -306,7 +306,7 @@ class FileController
306 $mime = $file->getMimeType(); 306 $mime = $file->getMimeType();
307 $this->saveMysql($fileModel,$size,$file_type,$fileName,$hash,$this->upload_location,$mime,$name); 307 $this->saveMysql($fileModel,$size,$file_type,$fileName,$hash,$this->upload_location,$mime,$name);
308 $data[] = $this->responseData($this->path.'/'.$fileName, $name); 308 $data[] = $this->responseData($this->path.'/'.$fileName, $name);
309 -// $this->synchronizationFile($fileName,$this->upload_location); 309 + $this->synchronizationFile($fileName,$this->upload_location);
310 } 310 }
311 $this->response('资源',Code::SUCCESS,$data); 311 $this->response('资源',Code::SUCCESS,$data);
312 } 312 }