zhangqian
2023-10-13 88702f1d3db33a3ee166ba7615ae39b8a719143f
model/serviceOrder.go
@@ -61,13 +61,14 @@
   // ServiceOrderSearch 服务单搜索条件
   ServiceOrderSearch struct {
      ServiceOrder
      Orm         *gorm.DB
      QueryClass  constvar.ServiceOrderQueryClass
      KeywordType constvar.ServiceOrderKeywordType
      Keyword     string
      PageNum     int
      PageSize    int
      Preload     bool
      Orm           *gorm.DB
      QueryClass    constvar.ServiceOrderQueryClass
      KeywordType   constvar.ServiceOrderKeywordType
      Keyword       string
      PageNum       int
      PageSize      int
      Preload       bool
      ServiceManIds []int
   }
)
@@ -124,6 +125,10 @@
      db = db.Joins("ServiceType", clause.LeftJoin).Where("ServiceType.name like ?", fmt.Sprintf("%%%s%%", slf.Keyword))
   case constvar.ServiceOrderKeywordFaultType:
      db = db.Joins("FaultType", clause.LeftJoin).Where("FaultType.name like ?", fmt.Sprintf("%%%s%%", slf.Keyword))
   }
   if len(slf.ServiceManIds) > 0 {
      db = db.Where("service_man_id in ?", slf.ServiceManIds)
   }
   return db
@@ -192,6 +197,11 @@
   return slf
}
func (slf *ServiceOrderSearch) SetMemberIds(memberIds []int) *ServiceOrderSearch {
   slf.ServiceManIds = memberIds
   return slf
}
func (slf *ServiceOrderSearch) SetPreload(preload bool) *ServiceOrderSearch {
   slf.Preload = preload
   return slf