You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use skipTotalRecords(), setTotalRecords(0), and setFilteredRecords(0) but the datatables class still query agregate to get the result count. Is there I'm missing here?
// @see https://yajrabox.com/docs/laravel-datatables/master/engine-query$db = DB::table("mhcustomer", "c")
->select(["c.nomor", "kode_hokky", "nama", "telepon_hp", "s.point", "s.point_tier"])
->join(DB::raw("(select `s`.`nomormhcustomer`, sum(s.jumlah) as point, sum(s.jumlah_tier) as point_tier from tsaldo_membership s group by s.nomormhcustomer) as `s`"), "s.nomormhcustomer", "=", "c.nomor");
return DataTables::of($db)
->skipTotalRecords()
->setTotalRecords(0)
->setFilteredRecords(0)
// see @https://datatables.yajrabox.com/eloquent/post-column-search// see @https://datatables.yajrabox.com/fluent/custom-filter untuk cata SULIT// terpaksa kalau kolomnya agregate kaya sum, count, iffnul, dll, tapi kalau ga, pakai get cukup// @see https://datatables.yajrabox.com/relation/has-one// Itu untuk Kasus Pakai Relationship nambah kolom, jadi ga perlu raw query
->setTransformer(function($item){
return [
'nomor' => $item->nomor,
'kode_hokky' => $item->kode_hokky,
'nama' => $item->nama,
'telepon_hp' => $item->telepon_hp,
'point' => $item->point,
'point_tier' => $item->point_tier,
'tier' => ''
];
})
->make(true);
System details
Operating System : Windows 10 1909
PHP Version : php 7.4
Laravel Version : 6.x
Laravel-Datatables Version : 1.5.0 (9.8.0)
The text was updated successfully, but these errors were encountered:
@benyaminl hi! have you figured this out? I'm having the same problem. Thanks!
skipTotalRecords doesn't take any params
/** * Skip total records and set the recordsTotal equals to recordsFiltered. * This will improve the performance by skipping the total count query. * * @return $this */publicfunctionskipTotalRecords()
{
$this->skipTotalRecords = true;
return$this;
}
Reffered to #578 and #779
Summary of problem or feature request
I use skipTotalRecords(), setTotalRecords(0), and setFilteredRecords(0) but the datatables class still query agregate to get the result count. Is there I'm missing here?

But when I dd the datatables object

The skipTotalRecords are true and I think it should return the set record or even not doing anything at all on
https://github.com/yajra/laravel-datatables/blob/9.0/src/QueryDataTable.php#L158-L167
and https://github.com/yajra/laravel-datatables/blob/9.0/src/QueryDataTable.php#L158-L167
But seems it's not working instead still query the agregate that cause slow process of datatables.
Code snippet of problem
System details
The text was updated successfully, but these errors were encountered: