fix
wangpengfei
2023-08-30 d7373b2a485e77c54c253932f98ef487cc4edfc7
fix

add supplier search with supplierNumber
2个文件已修改
6 ■■■■ 已修改文件
model/test/request/product.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/test/product.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/test/request/product.go
@@ -8,7 +8,7 @@
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
service/test/product.go
@@ -95,8 +95,8 @@
        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