From 3a23fe7c3512efb54eb816b7c8e37b5e0cafcdbf Mon Sep 17 00:00:00 2001 From: YuleiLan Date: Fri, 26 Mar 2021 13:30:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E5=B7=A5=E5=8D=95=E5=A4=84=E7=90=86?= =?UTF-8?q?=E8=80=97=E6=97=B6=E4=BF=9D=E7=95=99=E5=B0=8F=E6=95=B0=E7=82=B9?= =?UTF-8?q?2=E4=BD=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/dashboard.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/service/dashboard.go b/pkg/service/dashboard.go index 705583d..a364f46 100644 --- a/pkg/service/dashboard.go +++ b/pkg/service/dashboard.go @@ -254,7 +254,7 @@ func (s *Statistics) HandlePeriodRank() (interface{}, error) { err = orm.Eloquent.Model(&process.CirculationHistory{}). Joins("left join sys_user on sys_user.user_id = p_work_order_circulation_history.processor_id"). Where("p_work_order_circulation_history.source like 'receiveTask%' and p_work_order_circulation_history.status = 1 and p_work_order_circulation_history.create_time between ? and ?", s.StartTime, s.EndTime). - Select("p_work_order_circulation_history.processor_id as user_id, p_work_order_circulation_history.processor as nickname, sys_user.username as username, sum(p_work_order_circulation_history.cost_duration) as cost_duration"). + Select("p_work_order_circulation_history.processor_id as user_id, p_work_order_circulation_history.processor as nickname, sys_user.username as username, round(sum(p_work_order_circulation_history.cost_duration), 2) as cost_duration"). Group("p_work_order_circulation_history.processor, p_work_order_circulation_history.processor_id"). Order("cost_duration desc"). Scan(&ranks).Error From d2035f1bc1b433d65069e82cd6a763ea0986da88 Mon Sep 17 00:00:00 2001 From: YuleiLan Date: Fri, 26 Mar 2021 14:24:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E5=B7=A5=E5=8D=95=E5=A4=84=E7=90=86?= =?UTF-8?q?=E8=80=97=E6=97=B6=E4=BF=9D=E7=95=99=E5=B0=8F=E6=95=B0=E7=82=B9?= =?UTF-8?q?2=E4=BD=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/dashboard.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/service/dashboard.go b/pkg/service/dashboard.go index a364f46..5de9982 100644 --- a/pkg/service/dashboard.go +++ b/pkg/service/dashboard.go @@ -245,10 +245,10 @@ func (s *Statistics) HandlePeriodRank() (interface{}, error) { var ( err error ranks []struct { - UserID int `json:"user_id"` - Username string `json:"username"` - Nickname string `json:"nickname"` - CostDuration int `json:"cost_duration"` + UserID int `json:"user_id"` + Username string `json:"username"` + Nickname string `json:"nickname"` + CostDuration float64 `json:"cost_duration"` } ) err = orm.Eloquent.Model(&process.CirculationHistory{}).