From 0f7dbc99a9e0c0678d458e2f8f60df52f7fdb3d1 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 29 二月 2024 20:14:00 +0800 Subject: [PATCH] 添加纤度登记接口支持修改纤度登记 --- models/fineness_item.go | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/models/fineness_item.go b/models/fineness_item.go index 13995ee..2db1931 100644 --- a/models/fineness_item.go +++ b/models/fineness_item.go @@ -55,6 +55,11 @@ return slf } +func (slf *FinenessItemSearch) SetFinenessRegisterID(id uint) *FinenessItemSearch { + slf.FinenessRegisterID = id + return slf +} + func (slf *FinenessItemSearch) build() *gorm.DB { var db = slf.Orm.Table(slf.TableName()) @@ -66,6 +71,10 @@ db = db.Order(slf.Order) } + if slf.FinenessRegisterID != 0 { + db = db.Where("fineness_register_id = ?", slf.FinenessRegisterID) + } + return db } -- Gitblit v1.8.0