关于分页跳转到下一页 [ 2.0 版本 ]
我写了一个分页,点击跳转到下一页为什么没有相应数据显示出来,链接地址是:http://localhost/frontend/index.php?r=teacher/search&page=2&per-page=2
if (array_key_exists('category', $status_arr)) {
                $post_category = $status_arr['category'];
                $course = WebSales::find()->where(['and', 'category_id' => $post_category, ['in', 'id', $list_attribute]])->orderBy('id ASC');
                $pages = new Pagination(['totalCount' => $course->count(), 'pageSize' => 2]);
                $list_data = $course->offset($pages->offset)->limit($pages->limit)->asArray()->all();
                $pages_html = LinkPager::widget(['pagination' => $pages]);
                foreach ($list_data as $v) {
                    $li_html .=
                        '<li><div class="border-b"><img src="images/jc/kc2.jpg" /><img src="temp/ht/person.png" class="cj-jckcsuo1s"/><h1 class="cj-jckch1">THE DISPLAY NAME</br>'
                        . $v['category_name'] . '</h1><p class="cj-jckcp1">展演时间:2014-03-03</br>演出人:'.$v['title'].'</p><a class="cj-jckca1" href="">查看详情>></a></div></li>';
                }
            }
            $ajax_object = new AjaxObject();
            $ajax_object->content = $li_html;
            $ajax_object->pages = $pages_html;
            return $ajax_object;
 $(document).on('change','input[name=iCheck],input[name=Check]',function(){
        $.post('{$url}',{status:getStatus(),ajax:'status',_csrf:yii.getCsrfToken()},function(data){
            if(data.content!=undefined){
                $('.cj-jckcul3').html(data.content);
                $('.cj-yema').html(data.pages);
            }
        });
    });
共 2 个回答
awpp
            注册时间:2015-05-26
最后登录:2017-05-09
在线时长:28小时6分
    最后登录:2017-05-09
在线时长:28小时6分
- 粉丝2
 - 金钱540
 - 威望10
 - 积分920