作者 刘锟

update

@@ -332,6 +332,12 @@ class ProjectUpdate extends Command @@ -332,6 +332,12 @@ class ProjectUpdate extends Command
332 $gallery[] = ['alt' => '', 'url' => $this->source_download($img, $project_id, $domain_arr['host'], $web_url_domain, $home_url)]; 332 $gallery[] = ['alt' => '', 'url' => $this->source_download($img, $project_id, $domain_arr['host'], $web_url_domain, $home_url)];
333 } 333 }
334 } 334 }
  335 + //缩略图
  336 + $thumb = $gallery[0] ?? [];
  337 + if(isset($thumb['url']) && $thumb['url']){
  338 + //生成缩略图
  339 + $thumb['url'] = thumbImageByUrl($thumb['url']);
  340 + }
335 //关键词 341 //关键词
336 $keyword_id = ''; 342 $keyword_id = '';
337 if ($item['tags'] ?? []) { 343 if ($item['tags'] ?? []) {
@@ -371,7 +377,7 @@ class ProjectUpdate extends Command @@ -371,7 +377,7 @@ class ProjectUpdate extends Command
371 'content' => $content, 377 'content' => $content,
372 'category_id' => $category_id, 378 'category_id' => $category_id,
373 'keyword_id' => $keyword_id, 379 'keyword_id' => $keyword_id,
374 - 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '', 380 + 'thumb' => Arr::a2s($thumb),
375 'gallery' => Arr::a2s($gallery), 381 'gallery' => Arr::a2s($gallery),
376 'attrs' => Arr::a2s($attrs), 382 'attrs' => Arr::a2s($attrs),
377 'seo_mate' => Arr::a2s([ 383 'seo_mate' => Arr::a2s([
@@ -417,7 +423,7 @@ class ProjectUpdate extends Command @@ -417,7 +423,7 @@ class ProjectUpdate extends Command
417 'content' => $content, 423 'content' => $content,
418 'category_id' => $category_id, 424 'category_id' => $category_id,
419 'keyword_id' => $keyword_id, 425 'keyword_id' => $keyword_id,
420 - 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '', 426 + 'thumb' => Arr::a2s($thumb),
421 'gallery' => Arr::a2s($gallery), 427 'gallery' => Arr::a2s($gallery),
422 'attrs' => Arr::a2s($attrs), 428 'attrs' => Arr::a2s($attrs),
423 'seo_mate' => Arr::a2s([ 429 'seo_mate' => Arr::a2s([