合并分支 'lyh-server' 到 'master'
Lyh server 查看合并请求 !2658
正在显示
3 个修改的文件
包含
24 行增加
和
13 行删除
| @@ -64,6 +64,9 @@ class SyncProject extends Command | @@ -64,6 +64,9 @@ class SyncProject extends Command | ||
| 64 | */ | 64 | */ |
| 65 | public function handle() | 65 | public function handle() |
| 66 | { | 66 | { |
| 67 | + $api = new OaGlobalsoApi(); | ||
| 68 | + $data = $api->order_info(15063); | ||
| 69 | + dd($data); | ||
| 67 | while (true){ | 70 | while (true){ |
| 68 | $list = NoticeLog::where('type', NoticeLog::TYPE_PROJECT)->where('status', NoticeLog::STATUS_PENDING)->get(); | 71 | $list = NoticeLog::where('type', NoticeLog::TYPE_PROJECT)->where('status', NoticeLog::STATUS_PENDING)->get(); |
| 69 | foreach ($list as $item){ | 72 | foreach ($list as $item){ |
| @@ -102,7 +105,9 @@ class SyncProject extends Command | @@ -102,7 +105,9 @@ class SyncProject extends Command | ||
| 102 | $this->renewSync($data['data']); | 105 | $this->renewSync($data['data']); |
| 103 | } | 106 | } |
| 104 | // TODO 如果是续费项目 并且有GEO版本,需要处理GEO版本 | 107 | // TODO 如果是续费项目 并且有GEO版本,需要处理GEO版本 |
| 105 | - if (($data['data']['order_type'] == '续费') && !empty($data['data']['geo_plan'])) { | 108 | + if (($data['data']['order_type'] == '续费') && !empty($data['data']['geo_plan']) && ($data['data']['geo_plan'] != '无')) { |
| 109 | + // 续费单,并且有GEO版本, 正常版本不创建 初始化正常版本 | ||
| 110 | + $data['data']['plan_marketing'] = '无'; | ||
| 106 | //创建对应的GEO版本 | 111 | //创建对应的GEO版本 |
| 107 | $projectModel = new Project(); | 112 | $projectModel = new Project(); |
| 108 | $seo_plan = $this->versionSeoData($data['data']['geo_plan'] ?? ''); | 113 | $seo_plan = $this->versionSeoData($data['data']['geo_plan'] ?? ''); |
| @@ -51,12 +51,7 @@ class SyncTimeMinuteFile extends Command | @@ -51,12 +51,7 @@ 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 | + $code = $this->synchronizationFile($path); |
| 60 | if(200 != (int)$code){ | 55 | if(200 != (int)$code){ |
| 61 | echo date('Y-m-d H:i:s') . ' | 错误状态:' . $code . PHP_EOL; | 56 | echo date('Y-m-d H:i:s') . ' | 错误状态:' . $code . PHP_EOL; |
| 62 | $errorFileModel = new ErrorFile(); | 57 | $errorFileModel = new ErrorFile(); |
| @@ -67,6 +62,14 @@ class SyncTimeMinuteFile extends Command | @@ -67,6 +62,14 @@ class SyncTimeMinuteFile extends Command | ||
| 67 | return true; | 62 | return true; |
| 68 | } | 63 | } |
| 69 | 64 | ||
| 65 | + public function synchronizationFile($path_name){ | ||
| 66 | + //同步到大文件 | ||
| 67 | + $file_path = config('filesystems.disks.cos')['cdn1'].$path_name; | ||
| 68 | + $directoryPath = pathinfo($path_name, PATHINFO_DIRNAME); | ||
| 69 | + $cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php'; | ||
| 70 | + return shell_exec($cmd); | ||
| 71 | + } | ||
| 72 | + | ||
| 70 | /** | 73 | /** |
| 71 | * @remark :获取图片文件链接 | 74 | * @remark :获取图片文件链接 |
| 72 | * @name :getUrl | 75 | * @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 |
-
请 注册 或 登录 后发表评论