提交 c31b9627 编写于 作者: T Terry

category services

上级 b6f85638
......@@ -221,4 +221,12 @@ class Category extends Service
{
return $this->_category->getFilterCategory($category_id, $parent_id);
}
/**
* 得到category model的全名.
*/
public function getChildCategory($category_id)
{
return $this->_category->getChildCategory($category_id);
}
}
......@@ -500,7 +500,10 @@ class CategoryMongodb extends Service implements CategoryInterface
return $data;
}
public function getChildCategory($category_id) {
return $this->getChildCate($category_id);
}
protected function getChildCate($category_id)
{
//echo $category_id;
......@@ -521,6 +524,8 @@ class CategoryMongodb extends Service implements CategoryInterface
'name' => $currentName,
'url_key' => $currentUrlKey,
'parent_id' => $one['parent_id'],
'thumbnail_image' => $one['thumbnail_image'],
'image' => $one['image'],
];
}
}
......
......@@ -578,6 +578,11 @@ class CategoryMysqldb extends Service implements CategoryInterface
return $data;
}
public function getChildCategory($category_id) {
return $this->getChildCate($category_id);
}
protected function getChildCate($category_id)
{
......@@ -593,17 +598,19 @@ class CategoryMysqldb extends Service implements CategoryInterface
$one =$this->unserializeData($one) ;
$currentUrlKey = $one['url_key'];
$currentName = $one['name'];
$currentId = (string) $one['_id'];
$currentId = (string) $one['id'];
$arr[$currentId] = [
//'_id' => $currentId,
'name' => $currentName,
'url_key' => $currentUrlKey,
'parent_id' => $one['parent_id'],
'thumbnail_image' => $one['thumbnail_image'],
'image' => $one['image'],
];
}
}
return $arr;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册