正在显示
1 个修改的文件
包含
5 行增加
和
1 行删除
| @@ -259,6 +259,7 @@ class ProjectUpdate extends Command | @@ -259,6 +259,7 @@ class ProjectUpdate extends Command | ||
| 259 | } | 259 | } |
| 260 | //分类 | 260 | //分类 |
| 261 | $category_id = ''; | 261 | $category_id = ''; |
| 262 | + $category_arr = []; | ||
| 262 | if ($item['category'] ?? []) { | 263 | if ($item['category'] ?? []) { |
| 263 | $category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]); | 264 | $category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]); |
| 264 | $category_id = $logic->getLastCategory(array_column($category_arr, 'id')); | 265 | $category_id = $logic->getLastCategory(array_column($category_arr, 'id')); |
| @@ -291,7 +292,6 @@ class ProjectUpdate extends Command | @@ -291,7 +292,6 @@ class ProjectUpdate extends Command | ||
| 291 | 'route' => $route | 292 | 'route' => $route |
| 292 | ]); | 293 | ]); |
| 293 | $this->set_map($route, RouteMap::SOURCE_PRODUCT, $id, $project_id); | 294 | $this->set_map($route, RouteMap::SOURCE_PRODUCT, $id, $project_id); |
| 294 | - CategoryRelated::saveRelated($id, array_column($category_arr, 'id')); | ||
| 295 | CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PRODUCT, $id, $link_type, $language_list, $page_list); | 295 | CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PRODUCT, $id, $link_type, $language_list, $page_list); |
| 296 | } else { | 296 | } else { |
| 297 | $id = $product['id']; | 297 | $id = $product['id']; |
| @@ -309,6 +309,10 @@ class ProjectUpdate extends Command | @@ -309,6 +309,10 @@ class ProjectUpdate extends Command | ||
| 309 | ]), | 309 | ]), |
| 310 | 'sort' => $item['sort'] ?? 0, | 310 | 'sort' => $item['sort'] ?? 0, |
| 311 | ], ['id' => $id]); | 311 | ], ['id' => $id]); |
| 312 | + } | ||
| 313 | + | ||
| 314 | + //关联分类 | ||
| 315 | + if($category_arr){ | ||
| 312 | CategoryRelated::saveRelated($id, array_column($category_arr, 'id')); | 316 | CategoryRelated::saveRelated($id, array_column($category_arr, 'id')); |
| 313 | } | 317 | } |
| 314 | 318 |
-
请 注册 或 登录 后发表评论