yinbentan
2024-07-06 79aef24a785581d95343ccd99e9cb362b2bc9c97
models/warehouse.go
@@ -31,6 +31,7 @@
      Contacts                string                        `json:"contacts" gorm:"type:varchar(255);comment:联系人"`       //联系人
      FileTemplateCategoryIn  constvar.FileTemplateCategory `json:"fileTemplateCategoryIn" gorm:"type:int(11);comment:入库模版种类"`
      FileTemplateCategoryOut constvar.FileTemplateCategory `json:"fileTemplateCategoryOut" gorm:"type:int(11);comment:出库模版种类"`
      OpenMonthStats          constvar.BoolType             `gorm:"type:int(11);default:2;comment:是否开启月度统计" json:"openMonthStats"` //是否开启月度统计
   }
   WarehouseSearch struct {
@@ -103,6 +104,11 @@
   return slf
}
func (slf *WarehouseSearch) SetOpenMonthStats(open constvar.BoolType) *WarehouseSearch {
   slf.OpenMonthStats = open
   return slf
}
func (slf *WarehouseSearch) build() *gorm.DB {
   var db = slf.Orm.Table(slf.TableName())
@@ -134,6 +140,10 @@
      db = db.Where("code in ?", slf.Codes)
   }
   if slf.OpenMonthStats != 0 {
      db = db.Where("open_month_stats = ?", slf.OpenMonthStats)
   }
   return db
}