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

---
 model/receipt.go |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/model/receipt.go b/model/receipt.go
index 2ca94cf..ff0a169 100644
--- a/model/receipt.go
+++ b/model/receipt.go
@@ -34,12 +34,13 @@
 	// ReceiptSearch 鏀舵鍗曟悳绱㈡潯浠�
 	ReceiptSearch struct {
 		Receipt
-		Orm         *gorm.DB
-		QueryClass  constvar.ReceiptQueryClass
-		KeywordType constvar.ReceiptKeywordType
-		Keyword     string
-		PageNum     int
-		PageSize    int
+		Orm          *gorm.DB
+		QueryClass   constvar.ReceiptQueryClass
+		KeywordType  constvar.ReceiptKeywordType
+		Keyword      string
+		PageNum      int
+		PageSize     int
+		PrincipalIds []int
 	}
 )
 
@@ -72,6 +73,11 @@
 	return slf
 }
 
+func (slf *ReceiptSearch) SetPrincipalIds(principalIds []int) *ReceiptSearch {
+	slf.PrincipalIds = principalIds
+	return slf
+}
+
 func (slf *ReceiptSearch) SetPage(page, size int) *ReceiptSearch {
 	slf.PageNum, slf.PageSize = page, size
 	return slf
@@ -91,6 +97,9 @@
 	if slf.ClientId != 0 {
 		db = db.Where("client_id = ?", slf.ClientId)
 	}
+	if len(slf.PrincipalIds) != 0 {
+		db = db.Where("principal_id in ?", slf.PrincipalIds)
+	}
 
 	return db
 }

--
Gitblit v1.8.0