作者 lyh

Merge branch 'master-lyh-edit' of http://47.244.231.31:8099/zhl/globalso-v6

@@ -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 }
@@ -51,7 +51,7 @@ return [ @@ -51,7 +51,7 @@ return [
51 'url' => env('AWS_URL'), 51 'url' => env('AWS_URL'),
52 'endpoint' => env('AWS_ENDPOINT'), 52 'endpoint' => env('AWS_ENDPOINT'),
53 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 53 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
54 - 'cdn'=>'https://v6-file.globalso.com' 54 + 'cdn'=>'https://globalso-v6.s3.us-west-2.amazonaws.com'
55 ], 55 ],
56 56
57 'upload' => [ 57 'upload' => [