http://localhost/user/pagination?page=1&sort=add_time
namespase app\controller;
use app\models\ShopInfo;
use yii\web\Controller;
use yii\data\Pagination;
use yii\widgets\LinkPager;
use yii\data\Sort;
use yii\helpers\Inflector;
class UserController extends Controller {
public function actionPagination()
{
$query = ShopInfo::find()->where(['shop_type' => 1]);
$count = $query->count();
$pagination = new Pagination(['totalCount' => $count,'defaultPageSize' => 10]);
$sort = new Sort([
'attributes' => [
'add_time' => [
'asc' => ['add_time' => SORT_ASC],
'desc' => ['add_time' => SORT_DESC],
'default' => SORT_DESC,
'label