From 8d2a95fc0eeabe1b13d0a914c9ec2845d42c0be3 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期四, 19 十月 2023 11:32:57 +0800
Subject: [PATCH] 添加主从serf切换事件
---
model/production_progress.go | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/model/production_progress.go b/model/production_progress.go
index bbdeb98..d928936 100644
--- a/model/production_progress.go
+++ b/model/production_progress.go
@@ -20,10 +20,11 @@
ProductionProgressSearch struct {
ProductionProgress
- Order string
- PageNum int
- PageSize int
- Orm *gorm.DB
+ Order string
+ PageNum int
+ PageSize int
+ Orm *gorm.DB
+ UnFinished bool
}
)
@@ -78,6 +79,11 @@
return slf
}
+func (slf *ProductionProgressSearch) SetUnFinished() *ProductionProgressSearch {
+ slf.UnFinished = true
+ return slf
+}
+
func (slf *ProductionProgressSearch) build() *gorm.DB {
var db = slf.Orm.Model(&ProductionProgress{})
@@ -109,6 +115,10 @@
db = db.Where("channel = ?", slf.Channel)
}
+ if slf.UnFinished {
+ db = db.Where("finished_quantity < total_quantity")
+ }
+
return db
}
--
Gitblit v1.8.0