|
...
|
...
|
@@ -276,6 +276,7 @@ class ProjectUpdate extends Command |
|
|
|
|
|
|
|
$model = new Product();
|
|
|
|
$category_model = new Category();
|
|
|
|
$keyword_model = new Keyword();
|
|
|
|
$extend_model = new Extend();
|
|
|
|
$extend_info_model = new ExtendInfo();
|
|
|
|
$logic = new CategoryLogic();
|
|
...
|
...
|
@@ -297,6 +298,12 @@ class ProjectUpdate extends Command |
|
|
|
$category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]);
|
|
|
|
$category_id = $logic->getLastCategory(array_column($category_arr, 'id'));
|
|
|
|
}
|
|
|
|
//关键词
|
|
|
|
$keyword_id = '';
|
|
|
|
if ($item['tags'] ?? []) {
|
|
|
|
$keyword_arr = $keyword_model->list(['title' => ['in', array_column($item['tags'], 'name')]]);
|
|
|
|
$keyword_id = array_column($keyword_arr,'id');
|
|
|
|
}
|
|
|
|
//名称去掉特殊符号
|
|
|
|
$item['ttile'] = $this->special2str($item['ttile'] ?? '');
|
|
|
|
|
|
...
|
...
|
@@ -309,6 +316,7 @@ class ProjectUpdate extends Command |
|
|
|
'intro' => $item['short_description'] ?? '',
|
|
|
|
'content' => $item['content'] ?? '',
|
|
|
|
'category_id' => $category_id,
|
|
|
|
'keyword_id' => $keyword_id,
|
|
|
|
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
|
|
|
|
'gallery' => Arr::a2s($gallery),
|
|
|
|
'seo_mate' => Arr::a2s([
|
|
...
|
...
|
@@ -333,6 +341,7 @@ class ProjectUpdate extends Command |
|
|
|
'intro' => $item['short_description'] ?? '',
|
|
|
|
'content' => $item['content'] ?? '',
|
|
|
|
'category_id' => $category_id,
|
|
|
|
'keyword_id' => $keyword_id,
|
|
|
|
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
|
|
|
|
'gallery' => Arr::a2s($gallery),
|
|
|
|
'seo_mate' => Arr::a2s([
|
...
|
...
|
|