From 094afbdd77f7c989007fd06818de8aaaa80779ef Mon Sep 17 00:00:00 2001 From: devil_gong Date: Thu, 3 Jan 2019 15:10:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=B1=95=E7=A4=BA=E5=8F=8B?= =?UTF-8?q?=E6=83=85=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Common.php | 2 +- application/service/LinkService.php | 18 ++---------------- thinkphp/tpl/think_exception.tpl | 6 +++--- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/application/index/controller/Common.php b/application/index/controller/Common.php index 5f19053d8..246fdab5e 100755 --- a/application/index/controller/Common.php +++ b/application/index/controller/Common.php @@ -208,7 +208,7 @@ class Common extends Controller $this->assign('common_shop_notice', MyC('common_shop_notice')); // 友情链接 - $link = LinkService::LinkShowList(); + $link = LinkService::LinkList(['where'=>['is_enable'=>1]]); $this->assign('link_list', $link['data']); } diff --git a/application/service/LinkService.php b/application/service/LinkService.php index 7b5439565..504815712 100755 --- a/application/service/LinkService.php +++ b/application/service/LinkService.php @@ -22,21 +22,6 @@ use app\service\GoodsService; */ class LinkService { - /** - * 前端展示 - * @author Devil - * @blog http://gong.gg/ - * @version 1.0.0 - * @date 2018-09-29 - * @desc description - * @param [array] $params [输入参数] - */ - public static function LinkShowList($params = []) - { - $data = Db::name('Link')->where(['is_enable'=>1])->order('sort asc')->select(); - return DataReturn('处理成功', 0, $data); - } - /** * 列表 * @author Devil @@ -48,7 +33,8 @@ class LinkService */ public static function LinkList($params = []) { - $data = Db::name('Link')->order('sort asc')->select(); + $where = empty($params['where']) ? [] : $params['where']; + $data = Db::name('Link')->where($where)->order('sort asc')->select(); return DataReturn('处理成功', 0, $data); } diff --git a/thinkphp/tpl/think_exception.tpl b/thinkphp/tpl/think_exception.tpl index 19ecbdc1b..c3fa0d4c9 100755 --- a/thinkphp/tpl/think_exception.tpl +++ b/thinkphp/tpl/think_exception.tpl @@ -410,9 +410,9 @@