fix
add supplier search with name, number and supplier_type
| | |
| | | if info.SupplierType != "" { |
| | | db = db.Where("supplier_type LIKE ?", "%"+info.SupplierType+"%") |
| | | } |
| | | if info.Industry != "" { |
| | | db = db.Where("industry LIKE ?", "%"+info.Industry+"%") |
| | | } |
| | | if info.Contact != "" { |
| | | db = db.Where("contact LIKE ?", "%"+info.Contact+"%") |
| | | } |
| | | if info.Phone != "" { |
| | | db = db.Where("phone LIKE ?", "%"+info.Phone+"%") |
| | | } |
| | | if info.CreatedAt != nil { |
| | | db = db.Where("created_at = ?", info.CreatedAt) |
| | | } |
| | | err = db.Count(&total).Error |
| | | if err != nil { |
| | | return |