datatables where condition typesSum >= 20

datatables where condition typesSum >= 20

ridho008ridho008 Posts: 2Questions: 0Answers: 0

how to make typesSum >= 20

if(request()->ajax()) {
$model = Report::query()->select('report.', 'types_violations.', 'users.*', DB::raw('SUM(types_violations.sum_points) as typesSum'))
->join('types_violations', 'types_violations.id', '=', 'report.types_id')
->join('users', 'users.id', '=', 'report.user_id')
->where('report.status', 0)
->where('users.role', 0)
->groupBy('report.user_id')
// ->where('typesSum', 45)
->where('users.is_active', 1) // active account
// ->process()
->get();
return DataTables::of($model)->toJson();

File javascript
function load_data_filter_report()
{
$('#dataTableFilterReport').DataTable({
processing: true,
serverSide: true,
order: [[3, 'desc']],
language: {
lengthMenu: "Tampilkan MENU pelaporan per halaman",
zeroRecords: "Tidak ada yang ditemukan",
info: "Menampilkan halaman PAGE dari PAGES",
infoEmpty: "Tidak ada pelaporan yang tersedia",
infoFiltered: "(difilter dari MAX total data)"
},
ajax: {
url: /admin/filter-reports,
},
columns: [
{
data: 'fullname',
name: 'fullname',
searchable: true,
},
{
data: 'email',
name: 'email',
searchable: true,
},
{
data: reporting_date,
name: 'reporting_date'
},
{
data: typesSum,
name: typesSum
},
]
});
}

Replies

Sign In or Register to comment.