| | |
| | | Conditions string `json:"conditions" gorm:"column:conditions;type:text;comment:条件"` |
| | | Remark string `json:"remark" gorm:"column:remark;type:text;comment:备注"` |
| | | Products []Product `json:"products" gorm:"many2many:salesDetails_product;"` |
| | | gorm.Model `json:"-"` |
| | | } |
| | | |
| | | SalesDetailsSearch struct { |
| | |
| | | func (slf *SalesDetailsSearch) FindAll() ([]*SalesDetails, error) { |
| | | var db = slf.build() |
| | | var records = make([]*SalesDetails, 0) |
| | | err := db.Find(&records).Error |
| | | err := db.Preload("Products").Find(&records).Error |
| | | return records, err |
| | | } |