From 1d5205459e19b664acd2a93005698931ab76fb80 Mon Sep 17 00:00:00 2001 From: Anyon Date: Fri, 29 Nov 2019 17:37:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8E=E5=8F=B0=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Queue.php | 9 +++++++++ app/admin/view/queue/index.html | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/app/admin/controller/Queue.php b/app/admin/controller/Queue.php index dec1f1146..2bf427ee0 100644 --- a/app/admin/controller/Queue.php +++ b/app/admin/controller/Queue.php @@ -52,6 +52,15 @@ class Queue extends Controller $this->message = $exception->getMessage(); } } + // 任务状态统计 + $this->total = ['dos' => 0, 'pre' => 0, 'oks' => 0, 'ers' => 0]; + $this->app->db->name($this->table)->field('status,count(1) count')->group('status')->select()->each(function ($item) { + if ($item['status'] === 1) $this->total['pre'] = $item['count']; + if ($item['status'] === 2) $this->total['dos'] = $item['count']; + if ($item['status'] === 3) $this->total['oks'] = $item['count']; + if ($item['status'] === 4) $this->total['ers'] = $item['count']; + }); + $this->title = '系统任务管理'; $this->iswin = ProcessService::instance()->iswin(); // 任务列表查询分页处理 diff --git a/app/admin/view/queue/index.html b/app/admin/view/queue/index.html index 8016d72bd..636c455e6 100644 --- a/app/admin/view/queue/index.html +++ b/app/admin/view/queue/index.html @@ -19,6 +19,41 @@ {block name="content"}
+
+
+
+
待处理
+
{$total.pre|default=0}
+
待处理的任务数量
+
+ +
+
+
+
处理中
+
{$totals.dos|default=0}
+
处理中的任务数量
+
+ +
+
+
+
处理完成
+
{$total.oks|default=0}
+
处理完成的任务数量
+
+ +
+
+
+
处理失败
+
{$total.ers|default=0}
+
处理失败的任务数量
+
+ +
+
+ {include file='queue/index_search'} {notempty name='list'}