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

Method GetListByStatus

models/FriendModel.go:28–35  ·  view source on GitHub ↗

获取指定状态的友链 @param status 友链状态,-1表示全部状态的友链,0表示关闭状态的友链,1表示正常状态的友链 @return links 友链数组 @return rows 记录数 @return err 错误

(status int)

Source from the content-addressed store, hash-verified

26//@return rows 记录数
27//@return err 错误
28func (this *Friend) GetListByStatus(status int) (links []Friend, rows int64, err error) {
29 qs := orm.NewOrm().QueryTable(GetTableFriend())
30 if status == 0 || status == 1 {
31 qs = qs.Filter("Status", status)
32 }
33 rows, err = qs.OrderBy("sort", "-status", "-id").All(&links)
34 return
35}
36
37//获取友链
38func (this *Friend) Friends() (links []Friend) {

Callers 2

FriendsMethod · 0.95
GetMethod · 0.80

Calls 2

GetTableFriendFunction · 0.85
AllMethod · 0.80

Tested by

no test coverage detected