From 52d6ec2b86005444441a7c7033d7d2ffd35631d2 Mon Sep 17 00:00:00 2001 From: liujiandao <274878379@qq.com> Date: 星期二, 30 四月 2024 09:58:55 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/silk/silkServer --- models/raw_silk_rank_standard.go | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/models/raw_silk_rank_standard.go b/models/raw_silk_rank_standard.go index 5cb41e9..2b72ffc 100644 --- a/models/raw_silk_rank_standard.go +++ b/models/raw_silk_rank_standard.go @@ -49,6 +49,11 @@ return slf } +func (slf *RawSilkRankStandardSearch) SetFineness(start, end decimal.Decimal) *RawSilkRankStandardSearch { + slf.StartFineness, slf.EndFineness = start, end + return slf +} + func (slf *RawSilkRankStandardSearch) build() *gorm.DB { db := slf.Orm.Table(slf.TableName()) @@ -56,6 +61,10 @@ db = db.Where("id = ?", slf.ID) } + if !slf.StartFineness.IsZero() || !slf.EndFineness.IsZero() { + db = db.Where("start_fineness = ? and end_fineness = ?", slf.StartFineness, slf.EndFineness) + } + return db } -- Gitblit v1.8.0