| | |
| | | ReceiverPhone string `json:"receiverPhone" gorm:"type:varchar(31);comment:联系电话"` |
| | | ReceiverAddr string `json:"receiverAddr" gorm:"type:varchar(255);comment:收货地址"` |
| | | |
| | | LocationID int `json:"locationID" gorm:"type:int;not null;comment:源位置id"` //源位置id |
| | | 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"` //目标位置 |
| | | LocationID int `json:"locationID" gorm:"type:int;not null;comment:源位置id"` //源位置id |
| | | 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 { |
| | |
| | | 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{}) |
| | | |
| | |
| | | db = db.Where("base_operation_type = ?", slf.BaseOperationType) |
| | | } |
| | | |
| | | if slf.SalesDetailsNumber != "" { |
| | | db = db.Where("sales_details_number = ?", slf.SalesDetailsNumber) |
| | | } |
| | | |
| | | return db |
| | | } |
| | | |