From eba4eb850f0ecfb5839395aa125955ceaa2a454f Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 19 十月 2023 16:39:07 +0800 Subject: [PATCH] Merge branch 'feat-serf' --- service/progress.go | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/service/progress.go b/service/progress.go index 6eab830..ed904f1 100644 --- a/service/progress.go +++ b/service/progress.go @@ -1,9 +1,10 @@ package service import ( + "apsClient/conf" "apsClient/model" "errors" - "gorm.io/gorm" + "github.com/jinzhu/gorm" ) type ProgressService struct { @@ -54,7 +55,7 @@ var ok bool progressCache, ok = ProgressCacheGet(channel) if !ok { - progressCache, err = model.NewProductionProgressSearch(nil).SetChannel(channel).SetOrder("id desc").First() + progressCache, err = model.NewProductionProgressSearch(nil).SetDeviceId(conf.Conf.System.DeviceId).SetChannel(channel).SetOrder("id desc").First() if err == gorm.ErrRecordNotFound { return nil, errors.New("progress not found") } @@ -71,3 +72,9 @@ } return } + +// GetProgressList 鑾峰彇寰呭悓姝ヨ繘搴﹀伐搴� +func (slf ProgressService) GetProgressList() (progressList []*model.ProductionProgress, err error) { + progressList, err = model.NewProductionProgressSearch(nil).SetUnFinished().SetOrder("id desc").SetPage(1, 100).FindNotTotal() + return +} -- Gitblit v1.8.0