fix
liujiandao
2024-04-28 de4bcd1dead50b05f716bc5718be5540bdb96783
service/test/supplier.go
@@ -54,6 +54,10 @@
   db := global.GVA_DB.Model(&test.Supplier{})
   var ss []test.Supplier
   // 如果有条件搜索 下方会自动创建搜索语句
   if info.Keyword != "" {
      keyword := "%" + info.Keyword + "%"
      db = db.Where("name LIKE ? or number LIKE ?", keyword, keyword)
   }
   if info.StartCreatedAt != nil && info.EndCreatedAt != nil {
      db = db.Where("created_at BETWEEN ? AND ?", info.StartCreatedAt, info.EndCreatedAt)
   }
@@ -112,6 +116,9 @@
   if info.SupplierId > 0 {
      db = db.Where("supplier_id = ?", info.SupplierId)
   }
   if info.Number != "" {
      db = db.Where("number = ?", info.Number)
   }
   err := db.Count(&total).Error
   if err != nil {
      return ps, total, err