0
点赞
收藏
分享

微信扫一扫

thinkPHP 分页后如何处理数据

f12b11374cba 2024-03-13 阅读 9

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

thinkPHP 分页后如何处理数据_分页


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

thinkPHP 分页后如何处理数据_分页_02

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

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

你要保守你心,胜过保守一切。



举报

相关推荐

0 条评论