|
...
|
...
|
@@ -20,6 +20,8 @@ use App\Models\News\News; |
|
|
|
use App\Models\News\NewsCategory;
|
|
|
|
use App\Models\Product\Category;
|
|
|
|
use App\Models\Product\CategoryRelated;
|
|
|
|
use App\Models\Product\Column;
|
|
|
|
use App\Models\Product\Detail;
|
|
|
|
use App\Models\Product\Extend;
|
|
|
|
use App\Models\Product\ExtendInfo;
|
|
|
|
use App\Models\Product\Keyword;
|
|
...
|
...
|
@@ -335,7 +337,7 @@ class ProjectUpdate extends Command |
|
|
|
}
|
|
|
|
//名称去掉特殊符号
|
|
|
|
$item['ttile'] = $this->special2str($item['ttile'] ?? '');
|
|
|
|
|
|
|
|
$content = $item['content'] ?? '';
|
|
|
|
try {
|
|
|
|
$product = $model->read(['route' => $route], ['id', 'six_read']);
|
|
|
|
if (!$product) {
|
|
...
|
...
|
@@ -343,7 +345,7 @@ class ProjectUpdate extends Command |
|
|
|
'project_id' => $project_id,
|
|
|
|
'title' => $item['ttile'],
|
|
|
|
'intro' => $item['short_description'] ?? '',
|
|
|
|
'content' => $item['content'] ?? '',
|
|
|
|
'content' => $content,
|
|
|
|
'category_id' => $category_id,
|
|
|
|
'keyword_id' => $keyword_id,
|
|
|
|
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
|
|
...
|
...
|
@@ -364,6 +366,20 @@ class ProjectUpdate extends Command |
|
|
|
'six_read' => 1,
|
|
|
|
'route' => $route
|
|
|
|
]);
|
|
|
|
if(!empty($content)){
|
|
|
|
$data_s = [
|
|
|
|
'product_id'=>$id,
|
|
|
|
'column_id'=>1,
|
|
|
|
'text_type'=>1,
|
|
|
|
'title'=>'product detail',
|
|
|
|
'sort'=>1,
|
|
|
|
'content'=>json_encode(['content'=>$content ?? ''],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s')
|
|
|
|
];
|
|
|
|
$detailModel = new Detail();
|
|
|
|
$detailModel->insert($data_s);
|
|
|
|
}
|
|
|
|
$this->set_map($route, RouteMap::SOURCE_PRODUCT, $id, $project_id);
|
|
|
|
CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PRODUCT, $id, $domain_arr['host'], $link_type, $language_list, $page_list);
|
|
|
|
$six_read = 1;
|
|
...
|
...
|
@@ -375,7 +391,7 @@ class ProjectUpdate extends Command |
|
|
|
$model->edit([
|
|
|
|
'title' => $item['ttile'],
|
|
|
|
'intro' => $item['short_description'] ?? '',
|
|
|
|
'content' => $item['content'] ?? '',
|
|
|
|
'content' => $content,
|
|
|
|
'category_id' => $category_id,
|
|
|
|
'keyword_id' => $keyword_id,
|
|
|
|
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
|
|
...
|
...
|
@@ -391,8 +407,22 @@ class ProjectUpdate extends Command |
|
|
|
'files' => $files,
|
|
|
|
], ['id' => $id]);
|
|
|
|
}
|
|
|
|
if(!empty($content)){
|
|
|
|
$detailModel = new Detail();
|
|
|
|
$detailModel->del(['product_id'=>$id,'column_id'=>1]);
|
|
|
|
$data_s = [
|
|
|
|
'product_id'=>$id,
|
|
|
|
'column_id'=>1,
|
|
|
|
'text_type'=>1,
|
|
|
|
'title'=>'product detail',
|
|
|
|
'sort'=>1,
|
|
|
|
'content'=>json_encode(['content'=>$content ?? ''],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s')
|
|
|
|
];
|
|
|
|
$detailModel->insert($data_s);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($six_read) {
|
|
|
|
//关联分类
|
|
|
|
CategoryRelated::saveRelated($id, array_column($category_arr, 'id'));
|
...
|
...
|
|