From d20acf38c36c11ee4428c3e74a17f5870dc61b51 Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期四, 16 十一月 2023 09:51:00 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/aps/SRM

---
 service/test/supplier.go |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/service/test/supplier.go b/service/test/supplier.go
index b160aa6..5d7ac0c 100644
--- a/service/test/supplier.go
+++ b/service/test/supplier.go
@@ -60,12 +60,30 @@
 	if info.Name != "" {
 		db = db.Where("name LIKE ?", "%"+info.Name+"%")
 	}
+	if info.Number != "" {
+		db = db.Where("number LIKE ?", "%"+info.Number+"%")
+	}
+	if info.SupplierType != "" {
+		db = db.Where("srm_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
 	}
 
-	err = db.Limit(limit).Offset(offset).Preload("Contract").Find(&ss).Error
+	err = db.Debug().Limit(limit).Offset(offset).Order("created_at desc").Preload("Contract").Find(&ss).Error
 	return ss, total, err
 }
 

--
Gitblit v1.8.0