mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
完成博客的不分页面
This commit is contained in:
@@ -43,6 +43,11 @@ class System extends Common
|
||||
|
||||
return View::fetch();
|
||||
}
|
||||
public function blog()
|
||||
{
|
||||
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
|
||||
12
app/common/TextFormat.php
Normal file
12
app/common/TextFormat.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace app\common;
|
||||
|
||||
class TextFormat
|
||||
{
|
||||
public static function br($content){
|
||||
$content = str_replace("\n",'<br/>',$content);
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,29 @@ class Index extends Common
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function __blogIndex()
|
||||
{
|
||||
$list_category = Category::select();
|
||||
|
||||
$this->assign('list_category',$list_category);
|
||||
|
||||
$category_id = $this->request->param('category_id');
|
||||
|
||||
if(!empty($category_id)){
|
||||
|
||||
$model_list_post = Post::hasWhere('categorys',['category_id'=>$category_id])->order('sort desc');
|
||||
}else{
|
||||
|
||||
$model_list_post = Post::order('sort desc');
|
||||
}
|
||||
|
||||
$list_post = $model_list_post->paginate();
|
||||
|
||||
$this->assign('list_post',$list_post);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function __documentsIndex()
|
||||
{
|
||||
$list_index_documents_nav = Nav::where('type',9)->select();
|
||||
|
||||
Reference in New Issue
Block a user