开发者

Laravel Yajra datatables ajax serverside slow down page load

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜