|
@@ -308,6 +308,13 @@ class ProjectUpdate extends Command |
|
@@ -308,6 +308,13 @@ class ProjectUpdate extends Command |
|
308
|
$keyword_id = ',' . implode(',', array_column($keyword_arr, 'id')) . ',';
|
308
|
$keyword_id = ',' . implode(',', array_column($keyword_arr, 'id')) . ',';
|
|
309
|
}
|
309
|
}
|
|
310
|
}
|
310
|
}
|
|
|
|
311
|
+ //产品参数
|
|
|
|
312
|
+ $attrs = [];
|
|
|
|
313
|
+ if ($item['attr'] ?? []) {
|
|
|
|
314
|
+ foreach ($item['attr'] as $k_attr => $attr) {
|
|
|
|
315
|
+ $attrs[] = ['key' => $k_attr, 'value' => $attr];
|
|
|
|
316
|
+ }
|
|
|
|
317
|
+ }
|
|
311
|
//名称去掉特殊符号
|
318
|
//名称去掉特殊符号
|
|
312
|
$item['ttile'] = $this->special2str($item['ttile'] ?? '');
|
319
|
$item['ttile'] = $this->special2str($item['ttile'] ?? '');
|
|
313
|
|
320
|
|
|
@@ -323,6 +330,7 @@ class ProjectUpdate extends Command |
|
@@ -323,6 +330,7 @@ class ProjectUpdate extends Command |
|
323
|
'keyword_id' => $keyword_id,
|
330
|
'keyword_id' => $keyword_id,
|
|
324
|
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
|
331
|
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
|
|
325
|
'gallery' => Arr::a2s($gallery),
|
332
|
'gallery' => Arr::a2s($gallery),
|
|
|
|
333
|
+ 'attrs' => Arr::a2s($attrs),
|
|
326
|
'seo_mate' => Arr::a2s([
|
334
|
'seo_mate' => Arr::a2s([
|
|
327
|
'title' => $item['ttile'],
|
335
|
'title' => $item['ttile'],
|
|
328
|
'keyword' => $item['keywords'] ?? '',
|
336
|
'keyword' => $item['keywords'] ?? '',
|
|
@@ -353,6 +361,7 @@ class ProjectUpdate extends Command |
|
@@ -353,6 +361,7 @@ class ProjectUpdate extends Command |
|
353
|
'keyword_id' => $keyword_id,
|
361
|
'keyword_id' => $keyword_id,
|
|
354
|
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
|
362
|
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
|
|
355
|
'gallery' => Arr::a2s($gallery),
|
363
|
'gallery' => Arr::a2s($gallery),
|
|
|
|
364
|
+ 'attrs' => Arr::a2s($attrs),
|
|
356
|
'seo_mate' => Arr::a2s([
|
365
|
'seo_mate' => Arr::a2s([
|
|
357
|
'title' => $item['ttile'],
|
366
|
'title' => $item['ttile'],
|
|
358
|
'keyword' => $item['keywords'] ?? '',
|
367
|
'keyword' => $item['keywords'] ?? '',
|
|
@@ -361,7 +370,7 @@ class ProjectUpdate extends Command |
|
@@ -361,7 +370,7 @@ class ProjectUpdate extends Command |
|
361
|
'send_time' => $item['post_date'] ?? date('Y-m-d H:i:s'),
|
370
|
'send_time' => $item['post_date'] ?? date('Y-m-d H:i:s'),
|
|
362
|
'sort' => $item['sort'] ?? 0,
|
371
|
'sort' => $item['sort'] ?? 0,
|
|
363
|
], ['id' => $id]);
|
372
|
], ['id' => $id]);
|
|
364
|
- }else{
|
373
|
+ } else {
|
|
365
|
//按6.0展示只更新分类
|
374
|
//按6.0展示只更新分类
|
|
366
|
$model->edit([
|
375
|
$model->edit([
|
|
367
|
'category_id' => $category_id
|
376
|
'category_id' => $category_id
|
|
@@ -656,15 +665,15 @@ class ProjectUpdate extends Command |
|
@@ -656,15 +665,15 @@ class ProjectUpdate extends Command |
|
656
|
$item['title'] = $this->special2str($item['title'] ?? '');
|
665
|
$item['title'] = $this->special2str($item['title'] ?? '');
|
|
657
|
//排序
|
666
|
//排序
|
|
658
|
$sort = 0;
|
667
|
$sort = 0;
|
|
659
|
- if(isset($item['listorder'])){
|
668
|
+ if (isset($item['listorder'])) {
|
|
660
|
$sort = $item['listorder'];
|
669
|
$sort = $item['listorder'];
|
|
661
|
}
|
670
|
}
|
|
662
|
- if(isset($item['sort'])){
|
671
|
+ if (isset($item['sort'])) {
|
|
663
|
$sort = $item['sort'];
|
672
|
$sort = $item['sort'];
|
|
664
|
}
|
673
|
}
|
|
665
|
|
674
|
|
|
666
|
try {
|
675
|
try {
|
|
667
|
- $custom_content = $model->read(['route' => $route], ['id','six_read']);
|
676
|
+ $custom_content = $model->read(['route' => $route], ['id', 'six_read']);
|
|
668
|
if (!$custom_content) {
|
677
|
if (!$custom_content) {
|
|
669
|
$id = $model->insertGetId([
|
678
|
$id = $model->insertGetId([
|
|
670
|
'project_id' => $project_id,
|
679
|
'project_id' => $project_id,
|
|
@@ -688,7 +697,7 @@ class ProjectUpdate extends Command |
|
@@ -688,7 +697,7 @@ class ProjectUpdate extends Command |
|
688
|
} else {
|
697
|
} else {
|
|
689
|
$id = $custom_content['id'];
|
698
|
$id = $custom_content['id'];
|
|
690
|
$six_read = $custom_content['six_read'];
|
699
|
$six_read = $custom_content['six_read'];
|
|
691
|
- if($six_read){
|
700
|
+ if ($six_read) {
|
|
692
|
$model->edit([
|
701
|
$model->edit([
|
|
693
|
'name' => $item['title'],
|
702
|
'name' => $item['title'],
|
|
694
|
'category_id' => $category_id,
|
703
|
'category_id' => $category_id,
|
|
@@ -701,7 +710,7 @@ class ProjectUpdate extends Command |
|
@@ -701,7 +710,7 @@ class ProjectUpdate extends Command |
|
701
|
}
|
710
|
}
|
|
702
|
|
711
|
|
|
703
|
//扩展字段
|
712
|
//扩展字段
|
|
704
|
- if($six_read){
|
713
|
+ if ($six_read) {
|
|
705
|
if ($item['extend'] ?? []) {
|
714
|
if ($item['extend'] ?? []) {
|
|
706
|
foreach ($item['extend'] as $ke => $ve) {
|
715
|
foreach ($item['extend'] as $ke => $ve) {
|
|
707
|
$extend = $extend_model->read(['title' => $ke]);
|
716
|
$extend = $extend_model->read(['title' => $ke]);
|