liujiandao
2024-03-26 d3cf73c4718bc1972565277f038434a34f03907c
models/operation.go
@@ -47,6 +47,7 @@
      Location     Location `json:"location" gorm:"foreignkey:LocationID;references:Id"`          //源位置
      ToLocationID int      `json:"toLocationId"    gorm:"type:int;not null;comment:仓库位置id"`      //目标位置id
      ToLocation   Location `json:"toLocation"      gorm:"foreignKey:ToLocationID;references:Id"` //目标位置
      SalesDetailsNumber string   `gorm:"type:varchar(191);comment:销售明细编码" json:"salesDetailsNumber"`
   }
   OperationSearch struct {
@@ -136,6 +137,11 @@
   return slf
}
func (slf *OperationSearch) SetSalesDetailsNumber(salesDetailsNumber string) *OperationSearch {
   slf.SalesDetailsNumber = salesDetailsNumber
   return slf
}
func (slf *OperationSearch) build() *gorm.DB {
   var db = slf.Orm.Model(&Operation{})
@@ -182,6 +188,10 @@
      db = db.Where("base_operation_type = ?", slf.BaseOperationType)
   }
   if slf.SalesDetailsNumber != "" {
      db = db.Where("sales_details_number = ?", slf.SalesDetailsNumber)
   }
   return db
}