修改分类
This commit is contained in:
@@ -347,6 +347,7 @@ 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'] = 0;
|
||||||
if ( isset($parent_two[$v['category_id']]) ) {
|
if ( isset($parent_two[$v['category_id']]) ) {
|
||||||
$v['pid'] = $v['category_id'];
|
$v['pid'] = $v['category_id'];
|
||||||
$v['category_id'] = $parent_two[$v['category_id']];
|
$v['category_id'] = $parent_two[$v['category_id']];
|
||||||
|
|||||||
Reference in New Issue
Block a user