thinkPHP 分页后如何处理数据

thinkPHP 分页后如何处理数据?

$result = Db::table($table)->alias('cx')
    ->leftJoin('student s', 's.service_status = 1')
    ->leftJoin('subject sub', 'cx.subject_id = sub.id')
    ->where($where)
    ->field([
        'cx.subject_id',
        'sub.name as subject_name',
        's.username',
        's.phone'                    
    ])
    ->paginate($limit)->each(function($item){
        $item['smartyPro'] = $item['smartyPro'] . '%';
        $item['新字段'] =  '100%';
        return $item;
    });

手册地址:https://www.kancloud.cn/manual/thinkphp5_1/354120

image-20240207172421219



欢迎关注公-众-号【TaonyDaily】、留言、评论,一起学习。

公众号

Don’t reinvent the wheel, library code is there to help.

文章来源:刘俊涛的博客


若有帮助到您,欢迎点赞、转发、支持,您的支持是对我坚持最好的肯定(_)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章