Last active
November 9, 2018 12:28
-
-
Save gavinzhou/bfd8c3863c8f670303a807b10c18f52b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package models | |
type Tag struct { | |
Model | |
Name string `json:"name"` | |
CreatedBy string `json:"created_by"` | |
ModifiedBy string `json:"modified_by"` | |
State int `json:"state"` | |
} | |
func GetTags(pageNum int, pageSize int, maps interface{}) (tags []Tag) { | |
db.Where(maps).Offset(pageNum).Limit(pageSize).Find(&tags) | |
return | |
} | |
func GetTagTotal(maps interface{}) (count int) { | |
db.Model(&Tag{}).Where(maps).Count(&count) | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment