fix
wangpengfei
2023-08-30 88324f3d47dab99da5b4bd9422e50b63b97c242c
fix

add supplier search with name, number and supplier_type
1个文件已修改
12 ■■■■■ 已修改文件
service/test/supplier.go 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/test/supplier.go
@@ -66,6 +66,18 @@
    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