From e695d7c697196a36f8cdafc90e6a403a12707591 Mon Sep 17 00:00:00 2001 From: jiangshuai <291802688@qq.com> Date: 星期六, 21 十月 2023 17:43:36 +0800 Subject: [PATCH] 1.拆分报废、调拨、盘点列表接口 --- models/operation.go | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/models/operation.go b/models/operation.go index 5a126b3..cd60146 100644 --- a/models/operation.go +++ b/models/operation.go @@ -111,6 +111,10 @@ slf.Status = status return slf } +func (slf *OperationSearch) SetBaseOperationType(baseOperationType constvar.BaseOperationType) *OperationSearch { + slf.BaseOperationType = baseOperationType + return slf +} func (slf *OperationSearch) build() *gorm.DB { var db = slf.Orm.Model(&Operation{}) @@ -154,6 +158,10 @@ db = db.Where("status = ?", slf.Status) } + if int(slf.BaseOperationType) != 0 { + db = db.Where("base_operation_type=?", slf.BaseOperationType) + } + return db } -- Gitblit v1.8.0