mirror of
https://gitee.com/ulthon/layui-ul.git
synced 2026-07-07 04:42:48 +08:00
完成基本框架的搭建
This commit is contained in:
@@ -16,10 +16,23 @@ class Index extends Common
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function index()
|
||||
public function index($post_id = 0)
|
||||
{
|
||||
//
|
||||
|
||||
$list_post = Post::where('status', 1)->order('sort desc')->select();
|
||||
|
||||
if (empty($post_id)) {
|
||||
$model_post = $list_post->first();
|
||||
} else {
|
||||
$model_post = $list_post->where('id', $post_id)->first();
|
||||
}
|
||||
|
||||
|
||||
View::assign('model_post', $model_post);
|
||||
|
||||
View::assign('list_post', $list_post);
|
||||
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user