mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
初始化应用
This commit is contained in:
@@ -6,6 +6,7 @@ use app\model\Category;
|
||||
use app\model\Nav;
|
||||
use app\model\Post;
|
||||
use app\model\PostCategory;
|
||||
use think\facade\View;
|
||||
use think\Request;
|
||||
|
||||
class Index extends Common
|
||||
@@ -19,44 +20,7 @@ class Index extends Common
|
||||
{
|
||||
//
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function __blogIndex()
|
||||
{
|
||||
$list_category = Category::where('type','blog_post')->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');
|
||||
}
|
||||
|
||||
$model_list_post->where('type','blog_post');
|
||||
|
||||
$list_post = $model_list_post->paginate();
|
||||
|
||||
$this->assign('list_post',$list_post);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function __documentsIndex()
|
||||
{
|
||||
$list_index_documents_nav = Nav::where('type',9)->select();
|
||||
|
||||
$this->assign('list_index_documents_nav',$list_index_documents_nav);
|
||||
}
|
||||
|
||||
public function __articlesIndex()
|
||||
{
|
||||
|
||||
$sub_category = [];
|
||||
|
||||
if(!empty($this->request->param('category_id'))){
|
||||
@@ -89,11 +53,14 @@ class Index extends Common
|
||||
|
||||
$list_post = $model_post->paginate();
|
||||
|
||||
$this->assign('sub_category',$sub_category);
|
||||
View::assign('sub_category',$sub_category);
|
||||
|
||||
$this->assign('list_post',$list_post);
|
||||
View::assign('list_post',$list_post);
|
||||
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 显示创建资源表单页.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user