fix
add supplier search with supplierNumber
| | |
| | | |
| | | type ProductSearch struct { |
| | | test.Product |
| | | SupplierName string `json:"supplierName" form:"supplierName"` |
| | | SupplierNumber string `json:"supplierNumber" form:"supplierNumber"` |
| | | StartCreatedAt *time.Time `json:"startCreatedAt" form:"startCreatedAt"` |
| | | EndCreatedAt *time.Time `json:"endCreatedAt" form:"endCreatedAt"` |
| | | request.PageInfo |
| | |
| | | db = db.Where("product_type LIKE ?", "%"+info.ProductType+"%") |
| | | } |
| | | |
| | | if info.SupplierName != "" { |
| | | db = db.Joins("Supplier").Where("Supplier.name LIKE ?", "%"+info.SupplierName+"%") |
| | | if info.SupplierNumber != "" { |
| | | db = db.Joins("Supplier").Where("Supplier.number LIKE ?", "%"+info.SupplierNumber+"%") |
| | | } |
| | | |
| | | err = db.Count(&total).Error |