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.

文章來源:劉俊濤的博客


若有幫助到您,歡迎點贊、轉發、支持,您的支持是對我堅持最好的肯定(_)

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