| | |
| | | util.ResponseFormat(c, code.RequestParamError, "参数解析失败,数据类型错误") |
| | | return |
| | | } |
| | | list, err := models.NewOutsourcingOrderDeliveryDetailsSearch().SetOutsourcingOrderID(params.OutsourcingOrderID).SetPreload(true).FindNotTotal() |
| | | list, err := models.NewOutsourcingOrderDeliveryDetailsSearch(). |
| | | SetOutsourcingOrderID(params.OutsourcingOrderID). |
| | | SetPreload(true). |
| | | SetOrder("id desc"). |
| | | FindNotTotal() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "查询失败") |
| | | return |
| | |
| | | "specs": { |
| | | "type": "string" |
| | | }, |
| | | "type": { |
| | | "type": "string" |
| | | }, |
| | | "unit": { |
| | | "type": "string" |
| | | } |
| | |
| | | "specs": { |
| | | "type": "string" |
| | | }, |
| | | "type": { |
| | | "type": "string" |
| | | }, |
| | | "unit": { |
| | | "type": "string" |
| | | } |
| | |
| | | type: number |
| | | specs: |
| | | type: string |
| | | type: |
| | | type: string |
| | | unit: |
| | | type: string |
| | | type: object |
| | |
| | | PageNum int |
| | | PageSize int |
| | | Orm *gorm.DB |
| | | Order string |
| | | Preload bool |
| | | } |
| | | ) |
| | |
| | | |
| | | func (slf *OutsourcingOrderDeliveryDetailsSearch) SetOrm(tx *gorm.DB) *OutsourcingOrderDeliveryDetailsSearch { |
| | | slf.Orm = tx |
| | | return slf |
| | | } |
| | | |
| | | func (slf *OutsourcingOrderDeliveryDetailsSearch) SetOrder(order string) *OutsourcingOrderDeliveryDetailsSearch { |
| | | slf.Order = order |
| | | return slf |
| | | } |
| | | |
| | |
| | | db = db.Where("outsourcing_order_id = ?", slf.OutsourcingOrderID) |
| | | } |
| | | |
| | | if slf.Order != "" { |
| | | db = db.Order(slf.Order) |
| | | } |
| | | |
| | | if slf.Preload { |
| | | db = db.Preload("OutsourcingOrderDelivery").Preload("OutsourcingOrderProduct") |
| | | } |
| | |
| | | ProductId string `gorm:"type:varchar(191);comment:产品id" json:"productId"` |
| | | ProductName string `gorm:"type:varchar(191);comment:产品名称" json:"productName"` |
| | | Specs string `gorm:"type:varchar(191);comment:物料规格" json:"specs"` |
| | | Type string `gorm:"type:varchar(191);comment:物料型号" json:"type"` |
| | | Amount int64 `gorm:"type:int(11);comment:订单数量" json:"amount"` |
| | | Unit string `gorm:"type:varchar(100);comment:单位" json:"unit"` |
| | | BomID string `gorm:"type:varchar(255);default '';comment:bomID" json:"bomID"` |