From 5ebb79720e1c2a33af4b38c9f198a1e2e2309e50 Mon Sep 17 00:00:00 2001 From: zhaoxiang <756958008@qq.com> Date: Thu, 22 Feb 2018 23:52:24 +0800 Subject: [PATCH] =?UTF-8?q?added=20=E5=AE=8C=E6=88=90=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=92=8C=E6=8E=A5=E5=8F=A3=E7=BB=84=E7=9A=84=E5=85=B3=E8=81=94?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/InterfaceGroup.php | 15 +++++++++++++++ application/adminRoute.php | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/application/admin/controller/InterfaceGroup.php b/application/admin/controller/InterfaceGroup.php index 1099189..478b4a0 100644 --- a/application/admin/controller/InterfaceGroup.php +++ b/application/admin/controller/InterfaceGroup.php @@ -52,6 +52,21 @@ class InterfaceGroup extends Base { ]); } + /** + * 获取全部有效的接口组 + * @author zhaoxiang + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\ModelNotFoundException + * @throws \think\exception\DbException + */ + public function getAll() { + $listInfo = (new ApiGroup())->where(['status' => 1])->select(); + + return $this->buildSuccess([ + 'list' => $listInfo + ]); + } + /** * 接口组状态编辑 * @return array diff --git a/application/adminRoute.php b/application/adminRoute.php index 7cb61d2..be160a9 100644 --- a/application/adminRoute.php +++ b/application/adminRoute.php @@ -179,6 +179,10 @@ return [ 'admin/InterfaceGroup/del', ['method' => 'get', 'after_behavior' => $afterBehavior] ], + 'InterfaceGroup/getAll' => [ + 'admin/InterfaceGroup/getAll', + ['method' => 'get', 'after_behavior' => $afterBehavior] + ], 'InterfaceGroup/changeStatus' => [ 'admin/InterfaceGroup/changeStatus', ['method' => 'get', 'after_behavior' => $afterBehavior]