正在显示
2 个修改的文件
包含
17 行增加
和
13 行删除
| @@ -43,17 +43,18 @@ class SyncMobile extends Command | @@ -43,17 +43,18 @@ class SyncMobile extends Command | ||
| 43 | $data = $client->request('GET', $url, [ | 43 | $data = $client->request('GET', $url, [ |
| 44 | 'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号 | 44 | 'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号 |
| 45 | ])->getBody()->getContents(); | 45 | ])->getBody()->getContents(); |
| 46 | - $data = json_decode($data, true); | ||
| 47 | - DB::table('gl_mobile')->delete(); | ||
| 48 | - $create_time = date('Y-m-d H:i:s'); | ||
| 49 | - foreach ($data as $v){ | ||
| 50 | - $param = [ | ||
| 51 | - 'mobile'=>$v, | ||
| 52 | - 'created_at'=>$create_time | ||
| 53 | - ]; | ||
| 54 | - DB::table('gl_mobile')->insert($param); | ||
| 55 | - } | 46 | + dd($data); |
| 56 | if(!empty($data)){ | 47 | if(!empty($data)){ |
| 48 | + $data = json_decode($data, true); | ||
| 49 | + DB::table('gl_mobile')->delete(); | ||
| 50 | + $create_time = date('Y-m-d H:i:s'); | ||
| 51 | + foreach ($data as $v){ | ||
| 52 | + $param = [ | ||
| 53 | + 'mobile'=>$v, | ||
| 54 | + 'created_at'=>$create_time | ||
| 55 | + ]; | ||
| 56 | + DB::table('gl_mobile')->insert($param); | ||
| 57 | + } | ||
| 57 | $userModel = new User(); | 58 | $userModel = new User(); |
| 58 | try { | 59 | try { |
| 59 | $data[] = '13083988828'; | 60 | $data[] = '13083988828'; |
| @@ -665,7 +665,7 @@ if (!function_exists('getImageUrl')) { | @@ -665,7 +665,7 @@ if (!function_exists('getImageUrl')) { | ||
| 665 | * @method :post | 665 | * @method :post |
| 666 | * @time :2023/7/20 16:46 | 666 | * @time :2023/7/20 16:46 |
| 667 | */ | 667 | */ |
| 668 | - function getImageUrl($path,$storage_type = 0,$location = 0){ | 668 | + function getImageUrl($path,$storage_type = 0,$location = 0,$image_cdn = 1){ |
| 669 | if(is_array($path)){ | 669 | if(is_array($path)){ |
| 670 | $url =[]; | 670 | $url =[]; |
| 671 | foreach ($path as $v){ | 671 | foreach ($path as $v){ |
| @@ -683,8 +683,11 @@ if (!function_exists('getImageUrl')) { | @@ -683,8 +683,11 @@ if (!function_exists('getImageUrl')) { | ||
| 683 | } | 683 | } |
| 684 | if($location == 0){ | 684 | if($location == 0){ |
| 685 | $cos = config('filesystems.disks.cos'); | 685 | $cos = config('filesystems.disks.cos'); |
| 686 | - $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1']; | ||
| 687 | -// $cosCdn = 'https://file.globalso.com';//TODO::暂时使用 | 686 | + if($image_cdn == 0){//v6链接 |
| 687 | + $cosCdn = $cos['cdn2']; | ||
| 688 | + }else{ | ||
| 689 | + $cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1']; | ||
| 690 | + } | ||
| 688 | $url = $cosCdn.$path; | 691 | $url = $cosCdn.$path; |
| 689 | }else{ | 692 | }else{ |
| 690 | $s3 = config('filesystems.disks.s3'); | 693 | $s3 = config('filesystems.disks.s3'); |
-
请 注册 或 登录 后发表评论