开发者

Laravel Yajra datatables ajax serverside slow down page load

开发者 https://www.devze.com 2022-12-07 19:22 出处:网络
I\'m using Yajra datatables with serverside true, but page load very slow (afraid because of distinct count). I tried solution here by removing ->get() and it load faster but this causing another p

I'm using Yajra datatables with serverside true, but page load very slow (afraid because of distinct count). I tried solution here by removing ->get() and it load faster but this causing another problem, where the input searching (smart: true) return error, not functioning. Anyone can help?

Here is my开发者_运维问答 code:

$links = Link::with('owner')
->withCount(['clicks as uniqueClicks' => function($q) {
      $q->select(DB::raw('count(distinct(ip_address))'));
}])
->where('account_id', $account_id)
->orderBy('created_at','desc')
->get(); 

return Datatables::of($links)->make();
0

精彩评论

暂无评论...
验证码 换一张
取 消