lishihai
2024-07-03 91d7ca06128f996844aa7d2d691d083c944bdf1d
models/month_stats.go
@@ -9,7 +9,7 @@
)
type (
   // MonthStats 移动历史
   // MonthStats 月度统计
   MonthStats struct {
      WmsModel
      Id          int    `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
@@ -177,7 +177,8 @@
   }
   if slf.Keyword != "" {
      db = db.Where("product_name like ?", fmt.Sprintf("%%%v%%", slf.Keyword))
      kw := fmt.Sprintf("%%%v%%", slf.Keyword)
      db = db.Where("product_id like ? or product_name like ?", kw, kw)
   }
   if slf.Date != "" {
@@ -346,3 +347,12 @@
   }
   return m
}
func (slf *MonthStatsSearch) Count() (int64, error) {
   var (
      total int64
      db    = slf.build()
   )
   err := db.Count(&total).Error
   return total, err
}