修改分类
This commit is contained in:
@@ -347,7 +347,10 @@ class TopicNas extends Common
|
|||||||
$parent_two = ArticleCategoryModel::ParentChild(array_column($categorys, 'id'))->language($this->lang_id)->column('pid','id');//二级分类id
|
$parent_two = ArticleCategoryModel::ParentChild(array_column($categorys, 'id'))->language($this->lang_id)->column('pid','id');//二级分类id
|
||||||
$articles_data = $articles->toArray();
|
$articles_data = $articles->toArray();
|
||||||
foreach ($articles_data as &$v) {
|
foreach ($articles_data as &$v) {
|
||||||
$v['pid'] = isset($parent_two[$v['category_id']])?$parent_two[$v['category_id']]:'';
|
if ( isset($parent_two[$v['category_id']]) ) {
|
||||||
|
$v['pid'] = $v['category_id'];
|
||||||
|
$v['category_id'] = $parent_two[$v['category_id']];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return success('success', $articles_data);
|
return success('success', $articles_data);
|
||||||
|
|||||||
Reference in New Issue
Block a user