Laravel 5 Laravel-Yajra数据表排序列

Laravel 5 Laravel-Yajra数据表排序列,laravel-5,yajra-datatable,Laravel 5,Yajra Datatable,我一直坚持在addColumn上排序: 我有一个疑问: $userlist = DB::table('vv_users')->select('vv_users.user_id','vv_users.first_name', 'vv_users.mobile_number','vv_users.user_code','vv_users.user_type','vv_users.child_cnt','vv_users.unique_device_id')->where('vv_use

我一直坚持在addColumn上排序:

我有一个疑问:

 $userlist = DB::table('vv_users')->select('vv_users.user_id','vv_users.first_name',
'vv_users.mobile_number','vv_users.user_code','vv_users.user_type','vv_users.child_cnt','vv_users.unique_device_id')->where('vv_users.user_status', '=', 'Active')->whereNotNull('vv_users.uuid');
        return Datatables::of($userlist)
        
       ->addColumn('myteamcnt', function ($userlist) {
            $child_cnt = DB::table('vv_users')->where('user_status', '=', 'Active')->where('parent_id',$userlist->user_id)->count();
            return $child_cnt;
        })
        
       ->addColumn('whatsappid', function ($userlist) {
            return '<a href="https://api.whatsapp.com/send?phone=91'.$userlist->mobile_number.'&text=Hi%2C%20I%20found%20your%20business%20on%20vanigan" target="_blank" style="border-style: none"><img src="https://img.icons8.com/color/24/000000/whatsapp.png" style="" /></a>';
        })
        ->rawColumns(['whatsappid'])
        ->make(true);
        return Datatables::of($users)->make(true);
此代码运行良好。我只需要myteamcnt排序顺序…这不起作用

 $('#appmyteamusers').DataTable({
    "processing": true,
    "serverSide": true,
    dom: 'Blfrtip',
    "order": [[3, "desc" ]],
    lengthMenu: [
    [ 10, 25, 50, -1 ],
    [ '10 rows', '25 rows', '50 rows', 'Show all' ]
],
"iDisplayLength": 50,

    "ajax":{
        "url": "{{ url('admin/report/postappuserreport') }}",
        "dataType": "json",
        "type": "POST",
        "data":{ _token: "{{csrf_token()}}"}
    },
    "columns": [
        {data: 'user_id', name: 'vv_users.user_id'},
        {data: 'first_name', name: 'vv_users.first_name'},
        {data: 'mobile_number', name: 'vv_users.mobile_number'},
        {data: 'myteamcnt',name: 'myteamcnt', orderable: true,sortable : true },
        {data: 'unique_device_id', name: 'vv_users.unique_device_id'},
        {data: 'whatsappid', name: 'whatsappid'},
    ]
});