|
@@ -276,6 +276,7 @@ class ProjectUpdate extends Command |
|
@@ -276,6 +276,7 @@ class ProjectUpdate extends Command |
|
276
|
|
276
|
|
|
277
|
$model = new Product();
|
277
|
$model = new Product();
|
|
278
|
$category_model = new Category();
|
278
|
$category_model = new Category();
|
|
|
|
279
|
+ $keyword_model = new Keyword();
|
|
279
|
$extend_model = new Extend();
|
280
|
$extend_model = new Extend();
|
|
280
|
$extend_info_model = new ExtendInfo();
|
281
|
$extend_info_model = new ExtendInfo();
|
|
281
|
$logic = new CategoryLogic();
|
282
|
$logic = new CategoryLogic();
|
|
@@ -297,6 +298,12 @@ class ProjectUpdate extends Command |
|
@@ -297,6 +298,12 @@ class ProjectUpdate extends Command |
|
297
|
$category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]);
|
298
|
$category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]);
|
|
298
|
$category_id = $logic->getLastCategory(array_column($category_arr, 'id'));
|
299
|
$category_id = $logic->getLastCategory(array_column($category_arr, 'id'));
|
|
299
|
}
|
300
|
}
|
|
|
|
301
|
+ //关键词
|
|
|
|
302
|
+ $keyword_id = '';
|
|
|
|
303
|
+ if ($item['tags'] ?? []) {
|
|
|
|
304
|
+ $keyword_arr = $keyword_model->list(['title' => ['in', array_column($item['tags'], 'name')]]);
|
|
|
|
305
|
+ $keyword_id = array_column($keyword_arr,'id');
|
|
|
|
306
|
+ }
|
|
300
|
//名称去掉特殊符号
|
307
|
//名称去掉特殊符号
|
|
301
|
$item['ttile'] = $this->special2str($item['ttile'] ?? '');
|
308
|
$item['ttile'] = $this->special2str($item['ttile'] ?? '');
|
|
302
|
|
309
|
|
|
@@ -309,6 +316,7 @@ class ProjectUpdate extends Command |
|
@@ -309,6 +316,7 @@ class ProjectUpdate extends Command |
|
309
|
'intro' => $item['short_description'] ?? '',
|
316
|
'intro' => $item['short_description'] ?? '',
|
|
310
|
'content' => $item['content'] ?? '',
|
317
|
'content' => $item['content'] ?? '',
|
|
311
|
'category_id' => $category_id,
|
318
|
'category_id' => $category_id,
|
|
|
|
319
|
+ 'keyword_id' => $keyword_id,
|
|
312
|
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
|
320
|
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
|
|
313
|
'gallery' => Arr::a2s($gallery),
|
321
|
'gallery' => Arr::a2s($gallery),
|
|
314
|
'seo_mate' => Arr::a2s([
|
322
|
'seo_mate' => Arr::a2s([
|
|
@@ -333,6 +341,7 @@ class ProjectUpdate extends Command |
|
@@ -333,6 +341,7 @@ class ProjectUpdate extends Command |
|
333
|
'intro' => $item['short_description'] ?? '',
|
341
|
'intro' => $item['short_description'] ?? '',
|
|
334
|
'content' => $item['content'] ?? '',
|
342
|
'content' => $item['content'] ?? '',
|
|
335
|
'category_id' => $category_id,
|
343
|
'category_id' => $category_id,
|
|
|
|
344
|
+ 'keyword_id' => $keyword_id,
|
|
336
|
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
|
345
|
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
|
|
337
|
'gallery' => Arr::a2s($gallery),
|
346
|
'gallery' => Arr::a2s($gallery),
|
|
338
|
'seo_mate' => Arr::a2s([
|
347
|
'seo_mate' => Arr::a2s([
|