LIMIT
//SELECT * FROM newswhere is_delete=0 limit 0,10; $page为页码,$page_num为每页数量,limit(($page-1)*$page_num,$page_num)
Db::table('news')->where(['is_delete' => 0])->limit(0,10)->select();
PAGE
//SELECT * FROM newsWHERE is_delete=0 limit 0,10; page(页码,每页数量),第二页时,page(2,10)
Db::table('news')->where(['is_delete' => 0])->page(1,10)->select();
网友评论