zhangqian
2023-10-17 f75b6f9ee6b2c542d52b4a11113bd281b421c4c0
model/production_progress.go
@@ -20,10 +20,11 @@
   ProductionProgressSearch struct {
      ProductionProgress
      Order    string
      PageNum  int
      PageSize int
      Orm      *gorm.DB
      Order      string
      PageNum    int
      PageSize   int
      Orm        *gorm.DB
      UnFinished bool
   }
)
@@ -78,6 +79,11 @@
   return slf
}
func (slf *ProductionProgressSearch) SetUnFinished() *ProductionProgressSearch {
   slf.UnFinished = true
   return slf
}
func (slf *ProductionProgressSearch) build() *gorm.DB {
   var db = slf.Orm.Model(&ProductionProgress{})
@@ -109,6 +115,10 @@
      db = db.Where("channel = ?", slf.Channel)
   }
   if slf.UnFinished {
      db = db.Where("finished_quantity <  total_quantity")
   }
   return db
}