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

Method List

models/BannerModel.go:72–79  ·  view source on GitHub ↗

获取横幅列表 @param p 页码 @param listRows 每页记录数 @param status 横幅状态,0表示关闭,1表示正常,不传值则获取全部 @return banners 返回列表 @return rows 返回记录数 @return err 错误

(p, listRows int, status ...int)

Source from the content-addressed store, hash-verified

70//@return rows 返回记录数
71//@return err 错误
72func (this *Banner) List(p, listRows int, status ...int) (banners []Banner, rows int64, err error) {
73 qs := orm.NewOrm().QueryTable(GetTableBanner()).OrderBy("Sort", "-Status", "-Id").Limit(listRows).Offset((p - 1) * listRows)
74 if len(status) > 0 {
75 qs.Filter("Status__in", status)
76 }
77 rows, err = qs.All(&banners)
78 return
79}

Callers

nothing calls this directly

Calls 2

GetTableBannerFunction · 0.85
AllMethod · 0.80

Tested by

no test coverage detected