MCPcopy Create free account
hub / github.com/TruthHun/DocHub / GetByPid

Method GetByPid

models/CategoryModel.go:75–82  ·  view source on GitHub ↗

根据父级id获取分类

(pid int, status ...bool)

Source from the content-addressed store, hash-verified

73
74// 根据父级id获取分类
75func (this *Category) GetByPid(pid int, status ...bool) (categories []Category) {
76 q := orm.NewOrm().QueryTable(this).Filter("Pid", pid).OrderBy("Sort")
77 if len(status) > 0 {
78 q = q.Filter("Status", status[0])
79 }
80 q.All(&categories)
81 return
82}
83
84// get all categories
85func (this *Category) GetAll(status ...bool) (count int64, categories []Category) {

Callers 1

PrepareMethod · 0.80

Calls 1

AllMethod · 0.80

Tested by

no test coverage detected