作者 刘锟

合并分支 'akun' 到 'master'

update



查看合并请求 !272
@@ -252,7 +252,7 @@ class ProjectUpdate extends Command @@ -252,7 +252,7 @@ class ProjectUpdate extends Command
252 $gallery = []; 252 $gallery = [];
253 if ($item['images'] ?? []) { 253 if ($item['images'] ?? []) {
254 foreach ($item['images'] as $k_img => $img) { 254 foreach ($item['images'] as $k_img => $img) {
255 - $gallery[] = ['alt' => '这是一张产品图', 'url' => $this->source_download($img, $project_id, $domain_arr['host'], $web_url_domain, $home_url)]; 255 + $gallery[] = ['alt' => 'This is a product picture', 'url' => $this->source_download($img, $project_id, $domain_arr['host'], $web_url_domain, $home_url)];
256 } 256 }
257 } 257 }
258 //分类 258 //分类
@@ -292,6 +292,19 @@ class ProjectUpdate extends Command @@ -292,6 +292,19 @@ class ProjectUpdate extends Command
292 echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', error: ' . $e->getMessage() . PHP_EOL; 292 echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', error: ' . $e->getMessage() . PHP_EOL;
293 continue; 293 continue;
294 } 294 }
  295 + } else {
  296 + $gallery = [];
  297 + if ($item['images'] ?? []) {
  298 + foreach ($item['images'] as $k_img => $img) {
  299 + $gallery[] = ['alt' => 'This is a product picture', 'url' => $this->source_download($img, $project_id, $domain_arr['host'], $web_url_domain, $home_url)];
  300 + }
  301 + }
  302 +
  303 + $edit = [
  304 + 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
  305 + 'gallery' => Arr::a2s($gallery)
  306 + ];
  307 + $model->edit($edit, ['id' => $product['id']]);
295 } 308 }
296 } 309 }
297 } 310 }
@@ -595,7 +608,7 @@ class ProjectUpdate extends Command @@ -595,7 +608,7 @@ class ProjectUpdate extends Command
595 if ($source == RouteMap::SOURCE_NEWS) { 608 if ($source == RouteMap::SOURCE_NEWS) {
596 $route_map->path = RouteMap::SOURCE_NEWS; 609 $route_map->path = RouteMap::SOURCE_NEWS;
597 } elseif ($source == RouteMap::SOURCE_BLOG) { 610 } elseif ($source == RouteMap::SOURCE_BLOG) {
598 - $route_map->path = RouteMap::SOURCE_BLOG.'s'; 611 + $route_map->path = RouteMap::SOURCE_BLOG . 's';
599 } 612 }
600 613
601 $route_map->save(); 614 $route_map->save();