正在显示
1 个修改的文件
包含
4 行增加
和
4 行删除
| @@ -108,7 +108,7 @@ class AiVideoAutoPublish extends Command | @@ -108,7 +108,7 @@ class AiVideoAutoPublish extends Command | ||
| 108 | */ | 108 | */ |
| 109 | public function getVideoInfo(){ | 109 | public function getVideoInfo(){ |
| 110 | $data = []; | 110 | $data = []; |
| 111 | - $random = rand(1, 2); | 111 | + $random = 2; |
| 112 | if($random == 1){//取产品 | 112 | if($random == 1){//取产品 |
| 113 | $productModel = new Product(); | 113 | $productModel = new Product(); |
| 114 | $info = $productModel->formatQuery(['status'=>1,'title'=>['!=',null],'intro'=>['!=',null]])->select(['title','gallery','intro'])->inRandomOrder()->first(); | 114 | $info = $productModel->formatQuery(['status'=>1,'title'=>['!=',null],'intro'=>['!=',null]])->select(['title','gallery','intro'])->inRandomOrder()->first(); |
| @@ -124,10 +124,10 @@ class AiVideoAutoPublish extends Command | @@ -124,10 +124,10 @@ class AiVideoAutoPublish extends Command | ||
| 124 | if (!empty($item['url'])) { | 124 | if (!empty($item['url'])) { |
| 125 | return [ | 125 | return [ |
| 126 | 'alt' => $item['title'] ?? $data['title'], | 126 | 'alt' => $item['title'] ?? $data['title'], |
| 127 | - 'url' => $item['url'], | 127 | + 'url' => getImageUrl($item['url']), |
| 128 | ]; | 128 | ]; |
| 129 | } | 129 | } |
| 130 | - return null; // 返回 null 让 array_filter 去除 | 130 | + return null; |
| 131 | }, $info['gallery'])); | 131 | }, $info['gallery'])); |
| 132 | return $data; | 132 | return $data; |
| 133 | }else{ | 133 | }else{ |
| @@ -151,7 +151,7 @@ class AiVideoAutoPublish extends Command | @@ -151,7 +151,7 @@ class AiVideoAutoPublish extends Command | ||
| 151 | if (!empty($item['url'])) { | 151 | if (!empty($item['url'])) { |
| 152 | return [ | 152 | return [ |
| 153 | 'alt' => $item['title'] ?? $data['title'], | 153 | 'alt' => $item['title'] ?? $data['title'], |
| 154 | - 'url' => $item['url'], | 154 | + 'url' => getImageUrl($item['url']), |
| 155 | ]; | 155 | ]; |
| 156 | } | 156 | } |
| 157 | return null; // 返回 null 让 array_filter 去除 | 157 | return null; // 返回 null 让 array_filter 去除 |
-
请 注册 或 登录 后发表评论