From 2e375c4ab67f68ea018fab7cb7bc5aeb201cc853 Mon Sep 17 00:00:00 2001 From: devil_gong Date: Thu, 3 Jan 2019 13:54:00 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2lang=E7=A7=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/view/default/lib/region_linkage.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/index/view/default/lib/region_linkage.html b/application/index/view/default/lib/region_linkage.html index 2bb60bcbf..c925a1db8 100755 --- a/application/index/view/default/lib/region_linkage.html +++ b/application/index/view/default/lib/region_linkage.html @@ -6,7 +6,7 @@ - + \ No newline at end of file From 3ede56f9f7c18a110ae1e959b5b838fafade4aad Mon Sep 17 00:00:00 2001 From: devil_gong Date: Thu, 3 Jan 2019 15:05:43 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E5=8F=8B=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 | 5 +++ .../index/view/default/public/footer_nav.html | 21 ++++++++++- application/service/LinkService.php | 15 ++++++++ public/static/index/default/css/common.css | 37 +++++++++++++++++++ 4 files changed, 77 insertions(+), 1 deletion(-) diff --git a/application/index/controller/Common.php b/application/index/controller/Common.php index 658b9fbb8..5f19053d8 100755 --- a/application/index/controller/Common.php +++ b/application/index/controller/Common.php @@ -17,6 +17,7 @@ use app\service\BuyService; use app\service\MessageService; use app\service\SearchService; use app\service\ConfigService; +use app\service\LinkService; /** * 前端公共控制器 @@ -205,6 +206,10 @@ class Common extends Controller // 商城公告 $this->assign('common_shop_notice', MyC('common_shop_notice')); + + // 友情链接 + $link = LinkService::LinkShowList(); + $this->assign('link_list', $link['data']); } /** diff --git a/application/index/view/default/public/footer_nav.html b/application/index/view/default/public/footer_nav.html index 4a41acd23..c725ee619 100755 --- a/application/index/view/default/public/footer_nav.html +++ b/application/index/view/default/public/footer_nav.html @@ -1,3 +1,20 @@ + +{{if !empty($link_list)}} +
+
+

友情链接

+
    + {{foreach $link_list as $v}} +
  • + {{$v.name}} +
  • + {{/foreach}} +
+
+
+{{/if}} + +
\ No newline at end of file diff --git a/application/service/LinkService.php b/application/service/LinkService.php index 85d179e46..7b5439565 100755 --- a/application/service/LinkService.php +++ b/application/service/LinkService.php @@ -22,6 +22,21 @@ 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 diff --git a/public/static/index/default/css/common.css b/public/static/index/default/css/common.css index 9ba6e93fc..e9c7e81db 100755 --- a/public/static/index/default/css/common.css +++ b/public/static/index/default/css/common.css @@ -447,6 +447,40 @@ background:url(../images/ibar_sprites.png) no-repeat;background-position:0px -23 .am-footer-default .am-footer-divider { padding: 0 5px; } +.am-footer-default .am-footer-miscs a { + color: #8e8e8e; +} + +/** + * 友情链接 + */ +.friendship-list { + margin-top: 20px; + margin-bottom: 10px; +} +.friendship-list h2 { + border-bottom: 1px solid #e3e0e0; + line-height: 26px; + color: #333; + font-weight: 500; + font-size: 14px; +} +.friendship-list ul { + overflow: hidden; +} +.friendship-list ul li { + float: left; + line-height: 26px; + text-align: center; +} +.friendship-list ul li:not(:last-child) { + margin-right: 10px; +} + +.friendship-list ul li:not(:last-child) a { + border-right: 1px solid #d4d4d4; + padding-right: 10px; +} /** @@ -458,6 +492,9 @@ background:url(../images/ibar_sprites.png) no-repeat;background-position:0px -23 padding-left: 0px; padding-right: 0px; } + .friendship-list { + padding: 0 5px; + } } /** From 094afbdd77f7c989007fd06818de8aaaa80779ef Mon Sep 17 00:00:00 2001 From: devil_gong Date: Thu, 3 Jan 2019 15:10:18 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E5=8F=8B=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 @@