| | |
| | | PlanSearch struct { |
| | | Plan |
| | | |
| | | Orm *gorm.DB |
| | | Keyword string |
| | | OrderBy string |
| | | PageNum int |
| | | PageSize int |
| | | Orm *gorm.DB |
| | | Keyword string |
| | | OrderBy string |
| | | PageNum int |
| | | PageSize int |
| | | MemberIds []int |
| | | } |
| | | ) |
| | | |
| | |
| | | } |
| | | if slf.Id != 0 { |
| | | db = db.Where("id = ?", slf.Id) |
| | | } |
| | | if len(slf.MemberIds) != 0 { |
| | | db = db.Where("member_id in ?", slf.MemberIds) |
| | | } |
| | | |
| | | return db |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *PlanSearch) SetMemberIds(ids []int) *PlanSearch { |
| | | slf.MemberIds = ids |
| | | return slf |
| | | } |
| | | |
| | | func (slf *PlanSearch) SetKeyword(keyword string) *PlanSearch { |
| | | slf.Keyword = keyword |
| | | return slf |