MCPcopy Index your code
hub / github.com/TruthHun/DocHub / GetSameLevelCategoryById

Method GetSameLevelCategoryById

models/CategoryModel.go:66–72  ·  view source on GitHub ↗

获取同级分类 @param id 当前同级分类的id @return cates 分类列表数据

(id interface{})

Source from the content-addressed store, hash-verified

64//@param id 当前同级分类的id
65//@return cates 分类列表数据
66func (this *Category) GetSameLevelCategoryById(id interface{}) (cates []Category) {
67 cate := Category{Id: helper.Interface2Int(id)}
68 o := orm.NewOrm()
69 o.Read(&cate)
70 o.QueryTable(GetTableCategory()).Filter("Pid", cate.Pid).All(&cates)
71 return
72}
73
74// 根据父级id获取分类
75func (this *Category) GetByPid(pid int, status ...bool) (categories []Category) {

Callers 1

ListMethod · 0.80

Calls 2

GetTableCategoryFunction · 0.85
AllMethod · 0.80

Tested by

no test coverage detected