| | |
| | | Name string `json:"name" gorm:"column:name;type:varchar(255);comment:产品名称"` |
| | | Price decimal.Decimal `json:"price" gorm:"column:price;type:decimal(10,2);comment:产品价格"` |
| | | Number string `json:"number" gorm:"column:number;type:varchar(255);comment:产品编号"` |
| | | Amount decimal.Decimal `json:"amount" gorm:"column:amount;type:int;comment:产品数量"` |
| | | Amount decimal.Decimal `json:"amount" gorm:"column:amount;type:decimal(12,2);comment:产品数量"` |
| | | Total decimal.Decimal `json:"total" gorm:"column:total;type:decimal(10,2);comment:产品总价"` |
| | | Desc string `json:"desc" gorm:"column:desc;type:varchar(255);comment:产品描述"` |
| | | Unit string `json:"unit" gorm:"column:unit;type:varchar(255);comment:单位"` |
| | | gorm.Model `json:"-"` |
| | | } |
| | | |
| | |
| | | if slf.Name != "" { |
| | | db = db.Where("name = ?", slf.Name) |
| | | } |
| | | if len(slf.Ids) != 0 { |
| | | db = db.Where("id in ?", slf.Ids) |
| | | } |
| | | |
| | | return db |
| | | } |