Db操作不支持each

浏览:203 发布日期:2017/09/08
5.0.0 - 普通 - 未处理
$a = Db::name('test')->where('type', 10)->paginate(10)->each(function($item){
            $item['content'] = '1111111111';
        });
        print_r( $a->toArray() );

///打印出
Array
(
    [total] => 9
    [per_page] => 10
    [current_page] => 1
    [last_page] => 1
    [data] => Array
        (
            [0] => Array
                (
                    [id] => 69
                    [type] => 10
                    [content] => 
                    [create_time] => 2017-07-30 15:25:01
                    [test_int] => 0
                )

            [1] => Array
                (
                    [id] => 70
                    [type] => 10
                    [content] => 
                    [create_time] => 2017-07-30 15:26:01
                    [test_int] => 0
                )

            [2] => Array
                (
                    [id] => 71
                    [type] => 10
                    [content] => 
                    [create_time] => 2017-07-30 15:27:02
                    [test_int] => 0
                )
评论(
后面还有条评论,点击查看>>