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

Method GetAll

models/CategoryModel.go:85–92  ·  view source on GitHub ↗

get all categories

(status ...bool)

Source from the content-addressed store, hash-verified

83
84// get all categories
85func (this *Category) GetAll(status ...bool) (count int64, categories []Category) {
86 q := orm.NewOrm().QueryTable(this)
87 if len(status) > 0 {
88 q = q.Filter("status", status[0])
89 }
90 count, _ = q.OrderBy("sort").All(&categories)
91 return
92}
93
94func (this *Category) GetCategoriesById(id ...interface{}) (cates []Category, err error) {
95 if len(id) == 0 {

Callers 1

GetMethod · 0.95

Calls 1

AllMethod · 0.80

Tested by

no test coverage detected