熊本污
- 熊本污 赞了回答
findone(id),id取个随机数
- 熊本污 赞了回答
$query = Article::find(); $countQuery = clone $query; $count = $countQuery->count(); // 得到总数 $perPage = ceil($count / 5); // 算出每页显示多少条 $pages = new Pagination(['totalCount' => $count]); $models = $query->offset($pages->offset) ->limit($perPage) // 设置每页显示多少条 ->all();
- 熊本污 发布了教程yii内使用sphinx