From 19a9687715dc79c275359443af55d6112cd5d704 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期二, 21 十一月 2023 19:01:42 +0800 Subject: [PATCH] 同步状态和生产数按id正序取 --- service/task.go | 2 +- service/progress.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/service/progress.go b/service/progress.go index 2e7bc07..4b3dca5 100644 --- a/service/progress.go +++ b/service/progress.go @@ -55,7 +55,7 @@ var ok bool progressCache, ok = ProgressCacheGet(channel) if !ok { - progressCache, err = model.NewProductionProgressSearch(nil).SetDeviceId(conf.Conf.CurrentDeviceID).SetChannel(channel).SetOrder("id desc").First() + progressCache, err = model.NewProductionProgressSearch(nil).SetDeviceId(conf.Conf.CurrentDeviceID).SetChannel(channel).SetOrder("id asc").First() if err == gorm.ErrRecordNotFound { return nil, errors.New("progress not found") } diff --git a/service/task.go b/service/task.go index a4e6931..d393b5f 100644 --- a/service/task.go +++ b/service/task.go @@ -198,7 +198,7 @@ // GetTaskStatusSync 鑾峰彇寰呭悓姝ヤ换鍔′俊鎭� func (slf TaskService) GetTaskStatusSync(limit int) ([]*model.TaskStatusSync, error) { - return model.NewTaskStatusSyncSearch(nil).SetOrder("id desc").SetPage(1, limit).FindNotTotal() + return model.NewTaskStatusSyncSearch(nil).SetOrder("id asc").SetPage(1, limit).FindNotTotal() } // RemoveTaskStatusSync 鍒犻櫎鍚屾瀹岀殑璁板綍 -- Gitblit v1.8.0