From 5f0170df9787c6f3ff17cc168b3f2e3f511453f6 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期二, 31 十月 2023 20:04:16 +0800
Subject: [PATCH] 支持职级降级的情况
---
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