作者 lyh

gx

@@ -101,6 +101,7 @@ class VideoTask extends Command @@ -101,6 +101,7 @@ class VideoTask extends Command
101 $task_project->save(); 101 $task_project->save();
102 continue; 102 continue;
103 } 103 }
  104 + $logo_bg = $this->getImage($domainInfo);
104 foreach ($keyword as $val) { 105 foreach ($keyword as $val) {
105 $log = KeywordVideoTaskLog::where(['project_id' => $task_project->project_id, 'keyword_id' => $val->id])->first(); 106 $log = KeywordVideoTaskLog::where(['project_id' => $task_project->project_id, 'keyword_id' => $val->id])->first();
106 if ($log){ 107 if ($log){
@@ -113,7 +114,7 @@ class VideoTask extends Command @@ -113,7 +114,7 @@ class VideoTask extends Command
113 'keyword' => $val->title, 114 'keyword' => $val->title,
114 'data' => json_encode(['url' => $keywordInfo['url'],'title' => $keywordInfo['title'], 115 'data' => json_encode(['url' => $keywordInfo['url'],'title' => $keywordInfo['title'],
115 'description' => $keywordInfo['keyword_content'], 'images' => $keywordInfo['product_list'], 116 'description' => $keywordInfo['keyword_content'], 'images' => $keywordInfo['product_list'],
116 - 'keywords' => $keywordInfo['keyword_list']]), 117 + 'keywords' => $keywordInfo['keyword_list'], 'logo_bg' => $logo_bg]),
117 'status' => KeywordVideoTaskLog::STATUS_INIT, 118 'status' => KeywordVideoTaskLog::STATUS_INIT,
118 'updated_at' => date('Y-m-d H:i:s'), 119 'updated_at' => date('Y-m-d H:i:s'),
119 'created_at' => date('Y-m-d H:i:s'), 120 'created_at' => date('Y-m-d H:i:s'),
@@ -138,7 +139,6 @@ class VideoTask extends Command @@ -138,7 +139,6 @@ class VideoTask extends Command
138 return true; 139 return true;
139 } 140 }
140 foreach ($subTask as $val) { 141 foreach ($subTask as $val) {
141 - $logo_bg = $this->getImage($val->project_id);  
142 $valData = (array)json_decode($val->data); 142 $valData = (array)json_decode($val->data);
143 $task_id = 'v6-' . uniqid(); 143 $task_id = 'v6-' . uniqid();
144 $data = [ 144 $data = [
@@ -148,8 +148,8 @@ class VideoTask extends Command @@ -148,8 +148,8 @@ class VideoTask extends Command
148 'keywords' => $valData['keywords'], 148 'keywords' => $valData['keywords'],
149 'description' => $valData['description'], 149 'description' => $valData['description'],
150 'images' => $valData['images'], 150 'images' => $valData['images'],
151 - 'logo'=> $logo_bg['logo'] ?? '',  
152 - 'bg'=> $logo_bg['bg'] ?? '' 151 + 'logo'=> $valData['logo_bg']['logo'] ?? '',
  152 + 'bg'=> $valData['logo_bg']['bg'] ?? ''
153 ], 153 ],
154 'task_id' => $task_id, 154 'task_id' => $task_id,
155 'callback_url' => env('APP_URL') . '/api/video_task_callback', 155 'callback_url' => env('APP_URL') . '/api/video_task_callback',
@@ -277,12 +277,7 @@ class VideoTask extends Command @@ -277,12 +277,7 @@ class VideoTask extends Command
277 * @method :post 277 * @method :post
278 * @time :2024/3/12 15:29 278 * @time :2024/3/12 15:29
279 */ 279 */
280 - public function getImage($project_id){  
281 - $domainModel = new DomainInfo();  
282 - $domainInfo = $domainModel->read(['project_id'=>$project_id]);  
283 - if($domainInfo === false){  
284 - return ['logo'=>'','ng'=> ''];  
285 - } 280 + public function getImage($domainInfo){
286 $dom = file_get_html('https://'.$domainInfo['domain'].'/'); 281 $dom = file_get_html('https://'.$domainInfo['domain'].'/');
287 $logoDom = $dom->find('.logo', 0)->find("img",0); 282 $logoDom = $dom->find('.logo', 0)->find("img",0);
288 if($logoDom != null){ 283 if($logoDom != null){