模型append方法结合分页paginate从而导致render失效

浏览:459 发布日期:2017/08/29
5.0.0 - 严重 - 未处理
在通过分页方法paginate()获取数据后。。
如果使用在该数据的基础上使用append追加获取器属性后。会导致paginate失效,,从而导致render()方法找不到的bug

$info = $this->user->where('status','>=',0)->field('password',true)->paginate();
dump($info->toArray());
dump($info->append(['status_text'])->toArray());

array(5) {
["total"] => int(7)
["per_page"] => int(15)
["current_page"] => int(1)
["last_page"] => int(1)
["data"] => array(2) {
[0] => array(9) {
["id"] => int(1)
["username"] => string(5) "admin"
["login_num"] => int(159)
["create_time"] => string(19) "1970-01-01 08:00:00"
["update_time"] => string(19) "2017-08-29 10:49:49"
["login_ip"] => string(14) "110.253.72.127"
["realname"] => string(0) ""
["email"] => string(12) "admin@qq.com"
["status"] => int(1)
}
[1] => array(9) {
["id"] => int(2)
["username"] => string(9) "549240290"
["login_num"] => int(12)
["create_time"] => string(19) "1970-01-01 08:00:00"
["update_time"] => string(19) "2017-08-11 11:21:44"
["login_ip"] => string(14) "110.253.75.129"
["realname"] => string(4) "9999"
["email"] => string(17) "5492240290@qq.com"
["status"] => int(1)
}

array(2) {
[0] => array(10) {
["id"] => int(1)
["username"] => string(5) "admin"
["login_num"] => int(159)
["create_time"] => string(19) "1970-01-01 08:00:00"
["update_time"] => string(19) "2017-08-29 10:49:49"
["login_ip"] => string(14) "110.253.72.127"
["realname"] => string(0) ""
["email"] => string(12) "admin@qq.com"
["status"] => int(1)
["status_text"] => string(6) "启用"
}
[1] => array(10) {
["id"] => int(2)
["username"] => string(9) "549240290"
["login_num"] => int(12)
["create_time"] => string(19) "1970-01-01 08:00:00"
["update_time"] => string(19) "2017-08-11 11:21:44"
["login_ip"] => string(14) "110.253.75.129"
["realname"] => string(4) "9999"
["email"] => string(17) "5492240290@qq.com"
["status"] => int(1)
["status_text"] => string(6) "启用"
}
评论(
后面还有条评论,点击查看>>