作者 李宇航

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

Lyh server



查看合并请求 !2658
... ... @@ -64,6 +64,9 @@ class SyncProject extends Command
*/
public function handle()
{
$api = new OaGlobalsoApi();
$data = $api->order_info(15063);
dd($data);
while (true){
$list = NoticeLog::where('type', NoticeLog::TYPE_PROJECT)->where('status', NoticeLog::STATUS_PENDING)->get();
foreach ($list as $item){
... ... @@ -102,7 +105,9 @@ class SyncProject extends Command
$this->renewSync($data['data']);
}
// TODO 如果是续费项目 并且有GEO版本,需要处理GEO版本
if (($data['data']['order_type'] == '续费') && !empty($data['data']['geo_plan'])) {
if (($data['data']['order_type'] == '续费') && !empty($data['data']['geo_plan']) && ($data['data']['geo_plan'] != '无')) {
// 续费单,并且有GEO版本, 正常版本不创建 初始化正常版本
$data['data']['plan_marketing'] = '无';
//创建对应的GEO版本
$projectModel = new Project();
$seo_plan = $this->versionSeoData($data['data']['geo_plan'] ?? '');
... ...
... ... @@ -51,12 +51,7 @@ class SyncTimeMinuteFile extends Command
echo date('Y-m-d H:i:s') . ' | file_ok:' . $dir.$path . PHP_EOL;
continue;
}
$this->param['name'] = basename($path);
$this->param['path'] = str_replace('/'.$this->param['name'],'',$path);
$file_path = $this->getUrl($this->param['path'].'/'.$this->param['name'], 0,0);
$cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->param['path'].'" https://v6-file.globalso.com/upload.php';
echo date('Y-m-d H:i:s') . ' | ' . $cmd . PHP_EOL;
$code = shell_exec($cmd);
$code = $this->synchronizationFile($path);
if(200 != (int)$code){
echo date('Y-m-d H:i:s') . ' | 错误状态:' . $code . PHP_EOL;
$errorFileModel = new ErrorFile();
... ... @@ -67,6 +62,14 @@ class SyncTimeMinuteFile extends Command
return true;
}
public function synchronizationFile($path_name){
//同步到大文件
$file_path = config('filesystems.disks.cos')['cdn1'].$path_name;
$directoryPath = pathinfo($path_name, PATHINFO_DIRNAME);
$cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php';
return shell_exec($cmd);
}
/**
* @remark :获取图片文件链接
* @name :getUrl
... ...
... ... @@ -30,12 +30,7 @@ class SyncVideo extends Command
public function handle()
{
$path = $this->argument('path');
$this->param['name'] = basename($path);
$this->param['path'] = str_replace('/'.$this->param['name'],'',$path);
$file_path = $this->getUrl($this->param['path'].'/'.$this->param['name'], 0,0);
$cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->param['path'].'" https://v6-file.globalso.com/upload.php';
echo date('Y-m-d H:i:s') . ' | ' . $cmd . PHP_EOL;
$code = shell_exec($cmd);
$code = $this->synchronizationFile($path);
echo date('Y-m-d H:i:s') . ' | ' . $code . PHP_EOL;
if(200 != (int)$code){
echo date('Y-m-d H:i:s') . ' | ' . $code . PHP_EOL;
... ... @@ -45,6 +40,14 @@ class SyncVideo extends Command
return true;
}
public function synchronizationFile($path_name){
//同步到大文件
$file_path = config('filesystems.disks.cos')['cdn1'].$path_name;
$directoryPath = pathinfo($path_name, PATHINFO_DIRNAME);
$cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php';
return shell_exec($cmd);
}
/**
* @remark :获取图片文件链接
* @name :getUrl
... ...