作者 lyh

未续费项目增加搜索

@@ -51,12 +51,13 @@ class SyncTimeMinuteFile extends Command @@ -51,12 +51,13 @@ class SyncTimeMinuteFile extends Command
51 echo date('Y-m-d H:i:s') . ' | file_ok:' . $dir.$path . PHP_EOL; 51 echo date('Y-m-d H:i:s') . ' | file_ok:' . $dir.$path . PHP_EOL;
52 continue; 52 continue;
53 } 53 }
54 - $this->param['name'] = basename($path);  
55 - $this->param['path'] = str_replace('/'.$this->param['name'],'',$path);  
56 - $file_path = $this->getUrl($this->param['path'].'/'.$this->param['name'], 0,0);  
57 - $cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->param['path'].'" https://v6-file.globalso.com/upload.php';  
58 - echo date('Y-m-d H:i:s') . ' | ' . $cmd . PHP_EOL;  
59 - $code = shell_exec($cmd); 54 +// $this->param['name'] = basename($path);
  55 +// $this->param['path'] = str_replace('/'.$this->param['name'],'',$path);
  56 +// $file_path = $this->getUrl($this->param['path'].'/'.$this->param['name'], 0,0);
  57 +// $cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->param['path'].'" https://v6-file.globalso.com/upload.php';
  58 +// echo date('Y-m-d H:i:s') . ' | ' . $cmd . PHP_EOL;
  59 +// $code = shell_exec($cmd);
  60 + $code = $this->synchronizationFile($path);
60 if(200 != (int)$code){ 61 if(200 != (int)$code){
61 echo date('Y-m-d H:i:s') . ' | 错误状态:' . $code . PHP_EOL; 62 echo date('Y-m-d H:i:s') . ' | 错误状态:' . $code . PHP_EOL;
62 $errorFileModel = new ErrorFile(); 63 $errorFileModel = new ErrorFile();
@@ -67,6 +68,14 @@ class SyncTimeMinuteFile extends Command @@ -67,6 +68,14 @@ class SyncTimeMinuteFile extends Command
67 return true; 68 return true;
68 } 69 }
69 70
  71 + public function synchronizationFile($path_name){
  72 + //同步到大文件
  73 + $file_path = config('filesystems.disks.cos')['cdn1'].$path_name;
  74 + $directoryPath = pathinfo($path_name, PATHINFO_DIRNAME);
  75 + $cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php';
  76 + return shell_exec($cmd);
  77 + }
  78 +
70 /** 79 /**
71 * @remark :获取图片文件链接 80 * @remark :获取图片文件链接
72 * @name :getUrl 81 * @name :getUrl
@@ -30,12 +30,7 @@ class SyncVideo extends Command @@ -30,12 +30,7 @@ class SyncVideo extends Command
30 public function handle() 30 public function handle()
31 { 31 {
32 $path = $this->argument('path'); 32 $path = $this->argument('path');
33 - $this->param['name'] = basename($path);  
34 - $this->param['path'] = str_replace('/'.$this->param['name'],'',$path);  
35 - $file_path = $this->getUrl($this->param['path'].'/'.$this->param['name'], 0,0);  
36 - $cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->param['path'].'" https://v6-file.globalso.com/upload.php';  
37 - echo date('Y-m-d H:i:s') . ' | ' . $cmd . PHP_EOL;  
38 - $code = shell_exec($cmd); 33 + $code = $this->synchronizationFile($path);
39 echo date('Y-m-d H:i:s') . ' | ' . $code . PHP_EOL; 34 echo date('Y-m-d H:i:s') . ' | ' . $code . PHP_EOL;
40 if(200 != (int)$code){ 35 if(200 != (int)$code){
41 echo date('Y-m-d H:i:s') . ' | ' . $code . PHP_EOL; 36 echo date('Y-m-d H:i:s') . ' | ' . $code . PHP_EOL;
@@ -45,6 +40,14 @@ class SyncVideo extends Command @@ -45,6 +40,14 @@ class SyncVideo extends Command
45 return true; 40 return true;
46 } 41 }
47 42
  43 + public function synchronizationFile($path_name){
  44 + //同步到大文件
  45 + $file_path = config('filesystems.disks.cos')['cdn1'].$path_name;
  46 + $directoryPath = pathinfo($path_name, PATHINFO_DIRNAME);
  47 + $cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php';
  48 + return shell_exec($cmd);
  49 + }
  50 +
48 /** 51 /**
49 * @remark :获取图片文件链接 52 * @remark :获取图片文件链接
50 * @name :getUrl 53 * @name :getUrl