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/invoice.go | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-) diff --git a/model/invoice.go b/model/invoice.go index 0db64fa..7089b18 100644 --- a/model/invoice.go +++ b/model/invoice.go @@ -36,12 +36,13 @@ // InvoiceSearch 閿�鍞彂绁ㄦ悳绱㈡潯浠� InvoiceSearch struct { Invoice - Orm *gorm.DB - QueryClass constvar.InvoiceQueryClass - KeywordType constvar.InvoiceKeywordType - Keyword string - PageNum int - PageSize int + Orm *gorm.DB + QueryClass constvar.InvoiceQueryClass + KeywordType constvar.InvoiceKeywordType + Keyword string + PageNum int + PageSize int + PrincipalIds []int } ) @@ -65,6 +66,11 @@ return slf } +func (slf *InvoiceSearch) SetPrincipalIds(principalIds []int) *InvoiceSearch { + slf.PrincipalIds = principalIds + return slf +} + func (slf *InvoiceSearch) build() *gorm.DB { var db = slf.Orm.Model(&Invoice{}) if slf.Id != 0 { @@ -81,6 +87,9 @@ if slf.Number != "" { db.Where("number = ?", slf.Number) } + if len(slf.PrincipalIds) > 0 { + db = db.Where("principal_id in ?", slf.PrincipalIds) + } return db } -- Gitblit v1.8.0