wangpengfei
2023-07-26 e0a433e9c31594527a3bf7766c0bfb2cbbceffdb
model/serviceFollowup.go
@@ -28,7 +28,13 @@
   ServiceFollowupSearch struct {
      ServiceFollowup
      Orm *gorm.DB
            Orm      *gorm.DB
      Keyword  string
      OrderBy  string
      PageNum  int
      PageSize int
   }
)
@@ -44,6 +50,9 @@
func (slf *ServiceFollowupSearch) build() *gorm.DB {
   var db = slf.Orm.Model(&ServiceFollowup{})
   if slf.Keyword != "" {
      db = db.Where("name LIKE ?", "%"+slf.Keyword+"%")
   }
   if slf.Id != 0 {
      db = db.Where("id = ?", slf.Id)
   }
@@ -86,3 +95,18 @@
}
// 可能性 币种 当前状态(销售机会)
func (slf *ServiceFollowupSearch) SetKeyword(keyword string) *ServiceFollowupSearch {
   slf.Keyword = keyword
   return slf
}
func (slf *ServiceFollowupSearch) SetPage(page, size int) *ServiceFollowupSearch {
   slf.PageNum, slf.PageSize = page, size
   return slf
}
func (slf *ServiceFollowupSearch) SetOrder(order string) *ServiceFollowupSearch {
   slf.OrderBy = order
   return slf
}