From 0506bb97fc2dd486c36f123f0a48f5748f5911b3 Mon Sep 17 00:00:00 2001 From: 1099438829 <1099438829@qq.com> Date: Mon, 5 Apr 2021 23:35:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=80=E5=A4=A7=E6=B3=A2?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/view/system_config/base.html | 2 +- app/common/taglib/Zz.php | 2 +- app/index/common.php | 28 +- public/template/blog/1.html | 1194 ++++++++++++++++++ public/template/blog/index.html | 1267 ++++++++++++++++++++ public/template/default/index/index.html | 4 +- public/template/default/public/head.html | 84 +- public/template/default/public/header.html | 145 +-- 8 files changed, 2514 insertions(+), 212 deletions(-) create mode 100644 public/template/blog/1.html create mode 100644 public/template/blog/index.html diff --git a/app/admin/view/system_config/base.html b/app/admin/view/system_config/base.html index a7b3e16..b431941 100644 --- a/app/admin/view/system_config/base.html +++ b/app/admin/view/system_config/base.html @@ -118,7 +118,7 @@ formData.append("storage",1); $.ajax({ type:'POST', - url:'/admin/files/file', + url:'/admin/files/upload', data: formData, cache: false, processData: false, diff --git a/app/common/taglib/Zz.php b/app/common/taglib/Zz.php index 15bd4be..cf8172a 100644 --- a/app/common/taglib/Zz.php +++ b/app/common/taglib/Zz.php @@ -39,7 +39,7 @@ class Zz extends TagLib{ $row=isset($tag['row'])?$tag['row']:100; $void=isset($tag['void'])?$tag['void']:'field'; $where=isset($tag['where'])?$tag['where']:''; - $orderby=isset($tag['orderby'])?$tag['orderby']:'sort asc'; + $orderby=isset($tag['orderby'])?$tag['orderby']:'sort desc'; $display=isset($tag['display'])?$tag['display']:1; $display=$display==1?1:0; diff --git a/app/index/common.php b/app/index/common.php index dd95417..731f61d 100644 --- a/app/index/common.php +++ b/app/index/common.php @@ -49,7 +49,7 @@ function get_document_category_list(){ //缓存文章菜单 $docuemtCategory=cache('DATA_DOCUMENT_CATEGORY_LIST'); if($docuemtCategory===null){ - $docuemtCategoryList=Db::name('document_category')->where('status',1)->order('sort asc')->select(); + $docuemtCategoryList=Db::name('document_category')->order('sort desc')->select(); //转换,让id作为数组的键 $docuemtCategory=[]; foreach ($docuemtCategoryList as $key=>$item){ @@ -148,7 +148,7 @@ function tpl_get_channel($type,$typeid,$row,$where='',$orderby='',$display=1){ if(!$dc){ throw new Exception('分类不存在或已删除!'); } - $tempArr=Db::name('document_category')->where('id','in',$dc['child'])->where('status',1)->select(); + $tempArr=Db::name('document_category')->where('id','in',$dc['child'])->select(); if($display){ $tempArr=$tempArr->where('display',1); } @@ -179,8 +179,8 @@ function tpl_get_channel($type,$typeid,$row,$where='',$orderby='',$display=1){ $dc=get_document_category($typeid); if($dc['pid']!=0){ //获取根分类,此操作读取数据库,非缓存! - $dc=Db::name('document_category')->where('pid',0)->where('status',1) - -> where("CONCAT(',',child,',') like '%,$typeid,%'"); + $dc=Db::name('document_category')->where('pid',0) + ->where("CONCAT(',',child,',') like '%,$typeid,%'"); if($display){ $dc=$dc->where('display',1); } @@ -196,7 +196,7 @@ function tpl_get_channel($type,$typeid,$row,$where='',$orderby='',$display=1){ break; case 'where': //根据自定义条件获取分类(where语句),此操作读取数据库,非缓存! - $tempArr=Db::name('document_category')->where('status',1)-> where($where)->order($orderby); + $tempArr=Db::name('document_category')-> where($where)->order($orderby); if($display){ $tempArr=$tempArr->where('display',1); } @@ -210,7 +210,7 @@ function tpl_get_channel($type,$typeid,$row,$where='',$orderby='',$display=1){ break; case 'ids': //根据多个栏目id,逗号隔开的那种,获得栏目列表 - $tempArr=Db::name('document_category')->where('status',1)-> where('id','in',$typeid)->order($orderby); + $tempArr=Db::name('document_category')-> where('id','in',$typeid)->order($orderby); if($display){ $tempArr=$tempArr->where('display',1); } @@ -243,7 +243,11 @@ function get_document_category_by_parent($pid,$row,$display=1){ } if($item['pid']==$pid&&($display?$item['display']==1:true)){ $x=$x+1; - array_push($tempArr,$item); + $tempArr[$item['id']] = $item; + } + //判断是否有子元素,子元素则为其父元素的child字段设置为1 + if ($item['pid'] > 0 && !empty($tempArr[$item['pid']])){ + $tempArr[$item['pid']]['child'] = 1; } } return $tempArr; @@ -297,7 +301,7 @@ function tpl_get_list($orderby,$pagesize,$cid,$type,$table='article',$where=fals ->join(config('database.prefix').'document_category b','a.category_id=b.id','LEFT') ->join(config('database.prefix')."document_$table c",'a.id=c.id','RIGHT') ->where("a.type='$table'") - ->where('a.status',1)->where('b.status',1) + ->where('a.status',1) ->field('a.*,b.title as category_title,c.*'); if($display){ @@ -439,7 +443,7 @@ function tpl_get_article_list($cid,$row,$orderby,$table='article',$type='son',$w ->join(config('database.prefix').'document_category b','a.category_id=b.id','LEFT') ->join(config('database.prefix')."document_$table c",'a.id=c.id','RIGHT') ->where("a.type='$table'") - ->where('a.status',1)->where('b.status',1) + ->where('a.status',1) ->limit($row) ->field('a.*,b.title as category_title,c.*'); @@ -535,10 +539,10 @@ if (!function_exists('web_config')) */ function web_config(string $formName): string { - $webConfig = cache('webConfig'); + $webConfig = cache('systemConfig'); if (empty($webConfig)){ - $webConfig = Db::name('system_config')->where("status",1)->fetchSql(true)->column('value', 'form_name'); - cache('webConfig',$webConfig); + $webConfig = Db::name('system_config')->where("status",1)->column('value', 'form_name'); + cache('systemConfig',$webConfig); } return $webConfig[$formName]??''; } diff --git a/public/template/blog/1.html b/public/template/blog/1.html new file mode 100644 index 0000000..3c1df6e --- /dev/null +++ b/public/template/blog/1.html @@ -0,0 +1,1194 @@ + + + + -猿博 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+

搜索内容

+ +
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+ +
+ + + + +
+
+
+
最新文章 +
+
+
+ +
+ + + +
+
+ +
+ + +
+ +
+ +
+ + diff --git a/public/template/blog/index.html b/public/template/blog/index.html new file mode 100644 index 0000000..000cca3 --- /dev/null +++ b/public/template/blog/index.html @@ -0,0 +1,1267 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + 轻烟随风的博客blog + + + + + + + + +
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+

搜索内容

+ +
+
+ + + +
+
+
+
+
+
+
+
+ +
+ + + + +
+
+
+
最新文章 +
+
+
+ +
+ + + +
+
+ +
+ + +
+ + +
+ +
+ + diff --git a/public/template/default/index/index.html b/public/template/default/index/index.html index e56d3c5..8df924a 100644 --- a/public/template/default/index/index.html +++ b/public/template/default/index/index.html @@ -1,11 +1,9 @@ - 行业字典管理 - {:web_config("title")} - 轻烟随风的博客blog + -{:web_config("title")} - {include file="public/head" /} diff --git a/public/template/default/public/head.html b/public/template/default/public/head.html index 944116d..4c9fa6b 100644 --- a/public/template/default/public/head.html +++ b/public/template/default/public/head.html @@ -1,35 +1,31 @@ - + - - - - - + @@ -43,52 +39,4 @@ } - - -
- -
\ No newline at end of file + \ No newline at end of file diff --git a/public/template/default/public/header.html b/public/template/default/public/header.html index 6a79cfd..f73b6eb 100644 --- a/public/template/default/public/header.html +++ b/public/template/default/public/header.html @@ -1,53 +1,3 @@ -
- -
- - -
@@ -59,9 +9,7 @@ $(".user-menu-plane").appendTo($(".drawer-menu-list")); $(".menu-item-has-children").append('') $(".user-menu-main").append('') - } - function closeMenu() { $('body').css('overflow', 'auto'); $(".drawer-menu-plane").removeClass("drawer-menu-plane-show"); @@ -69,11 +17,9 @@ $(".menu-plane").prependTo($(".header-menu")); $(".m-dropdown").remove(); } - function openSearch() { $(".dialog-search-plane").addClass("dialog-search-plane-show"); } - function closeSearch() { //$('body').css('overflow', 'auto'); $(".dialog-search-plane").removeClass("dialog-search-plane-show"); @@ -90,7 +36,7 @@
+
@@ -99,9 +45,9 @@

搜索内容

-
- -