// GetList 获取实例的用户列表.
func (s sUserInfo) GetList(ctx context.Context, in model.UserInfoGetListInput) (items []entity.UserInfo, total int, err error) {
items = make([]entity.UserInfo, 0)
err = dao.UserInfo.Ctx(ctx).OmitEmpty().
Where(do.UserInfo{
ResourceId: in.ResourceId,
Status: in.Statuses,
}).
Order(in.OrderBy, in.OrderDirection).
Limit(in.Offset, in.Limit).
ScanAndCount(&items, &total, true)
return
}
4 Comments
刘保强
in.OrderDirection是个啥
Wankko Ree
排序顺序咯,
asc
或desc
Wankko Ree
等一手
ScanListAndCount
郭强
直接
Scan
就将查询记录转换到数组了。