From 6a132d799ea1256a7f570a759af6165e0654cc5a Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期一, 20 十一月 2023 18:00:12 +0800
Subject: [PATCH] 供应商查订单

---
 service/purchase/purchase.go |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/service/purchase/purchase.go b/service/purchase/purchase.go
index 4809c9b..4ed07b9 100644
--- a/service/purchase/purchase.go
+++ b/service/purchase/purchase.go
@@ -7,8 +7,8 @@
 	"github.com/spf13/cast"
 	"gorm.io/gorm"
 	"srm/global"
-	"srm/model/common/request"
 	"srm/model/purchase"
+	purchaserequest "srm/model/purchase/request"
 	"srm/proto/qualityinspect"
 	"srm/service/test"
 )
@@ -123,7 +123,7 @@
 //@param: info request.PageInfo
 //@return: list interface{}, total int64, err error
 
-func (slf *PurchaseService) GetPurchaseList(info request.PageInfo) (list interface{}, total int64, err error) {
+func (slf *PurchaseService) GetPurchaseList(info purchaserequest.PurchaseSearch) (list interface{}, total int64, err error) {
 	limit := info.PageSize
 	offset := info.PageSize * (info.Page - 1)
 	db := global.GVA_DB.Model(&purchase.Purchase{})
@@ -142,6 +142,9 @@
 		}
 	}
 
+	if info.SupplierId != 0 {
+		db = db.Where("supplier_id = ?", info.SupplierId)
+	}
 	err = db.Count(&total).Error
 	if err != nil {
 		return purchaseList, total, err

--
Gitblit v1.8.0