From cd37a9e7e491d65411941901bcfee641d9960548 Mon Sep 17 00:00:00 2001 From: Karson Date: Sat, 27 Mar 2021 23:03:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=8E=E5=8F=B0=E5=8F=B3?= =?UTF-8?q?=E4=B8=8A=E8=A7=92=E5=9B=BE=E6=A0=87=E6=96=87=E5=AD=97=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9D=83=E9=99=90=E8=A7=84=E5=88=99=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/auth/Rule.php | 4 +- application/admin/view/common/header.html | 26 +++++--- public/assets/js/backend/auth/rule.js | 70 ++++++++++++---------- public/assets/js/backend/index.js | 2 +- 4 files changed, 61 insertions(+), 41 deletions(-) diff --git a/application/admin/controller/auth/Rule.php b/application/admin/controller/auth/Rule.php index 80f23425..e7939f09 100644 --- a/application/admin/controller/auth/Rule.php +++ b/application/admin/controller/auth/Rule.php @@ -31,7 +31,7 @@ class Rule extends Backend } $this->model = model('AuthRule'); // 必须将结果集转换为数组 - $ruleList = collection($this->model->field('condition,remark,createtime,updatetime', true)->order('weigh DESC,id ASC')->select())->toArray(); + $ruleList = \think\Db::name("auth_rule")->field('type,condition,remark,createtime,updatetime', true)->order('weigh DESC,id ASC')->select(); foreach ($ruleList as $k => &$v) { $v['title'] = __($v['title']); } @@ -44,6 +44,7 @@ class Rule extends Backend continue; } $ruledata[$v['id']] = $v['title']; + unset($v['spacer']); } unset($v); $this->view->assign('ruledata', $ruledata); @@ -57,7 +58,6 @@ class Rule extends Backend if ($this->request->isAjax()) { $list = $this->rulelist; $total = count($this->rulelist); - $result = array("total" => $total, "rows" => $list); return json($result); diff --git a/application/admin/view/common/header.html b/application/admin/view/common/header.html index 2835a807..a0ca7d66 100755 --- a/application/admin/view/common/header.html +++ b/application/admin/view/common/header.html @@ -24,21 +24,21 @@