From dcdb38372cab3620ee1c3b3265115d9343044d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=BA=9A=E7=A3=8A?= Date: Tue, 7 Mar 2023 15:57:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=A6=96=E9=A1=B5=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E6=8E=92=E5=90=8D=E9=80=BB=E8=BE=91?= 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 c165ac73..baa0fd88 100644 --- a/pkg/service/dashboard.go +++ b/pkg/service/dashboard.go @@ -58,14 +58,14 @@ func (s *Statistics) DateRangeStatistics() (statisticsData map[string][]interfac sqlDataValue += fmt.Sprintf("SELECT date_sub(date_format( '%s', '%%Y%%m%%d'), INTERVAL 0 DAY ) AS click_date UNION ALL", endTime) } else if i == TimeDifference-1 { sqlDataValue += fmt.Sprintf(` SELECT date_sub(date_format( '%s', '%%Y%%m%%d'), INTERVAL %d DAY ) AS click_date UNION ALL`, endTime, i) - sqlDataValue += fmt.Sprintf(` SELECT date_sub(date_format( '%s', '%%Y%%m%%d'), INTERVAL %d DAY ) AS click_date`, endTime, i + 1) + sqlDataValue += fmt.Sprintf(` SELECT date_sub(date_format( '%s', '%%Y%%m%%d'), INTERVAL %d DAY ) AS click_date`, endTime, i+1) } else { sqlDataValue += fmt.Sprintf(` SELECT date_sub(date_format( '%s', '%%Y%%m%%d'), INTERVAL %d DAY ) AS click_date UNION ALL`, endTime, i) } } if TimeDifference == 1 { - sqlDataValue += fmt.Sprintf(" SELECT date_sub(date_format( '%s', '%%Y%%m%%d'), INTERVAL 1 DAY ) AS click_date",endTime) + sqlDataValue += fmt.Sprintf(" SELECT date_sub(date_format( '%s', '%%Y%%m%%d'), INTERVAL 1 DAY ) AS click_date", endTime) } sqlValue = fmt.Sprintf(`SELECT @@ -237,7 +237,7 @@ func (s *Statistics) HandlePersonRank() (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). + Where("(p_work_order_circulation_history.source like 'receiveTask%' or p_work_order_circulation_history.source like 'userTask%') 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, count(p_work_order_circulation_history.id) as count"). Group("p_work_order_circulation_history.processor, p_work_order_circulation_history.processor_id"). Order("count desc"). @@ -258,7 +258,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). + Where("(p_work_order_circulation_history.source like 'receiveTask%' or p_work_order_circulation_history.source like 'userTask%') 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, 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").