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'}