Skip to content
Advertisement

Adding GROUP BY support to the ssp class in complex function

I am using datatables v 1.10.19 As i was using the following ,the group by destroys the pagination and only shows one page.

JavaScript

here is the complex function for this:

JavaScript

The question is what should be added/changed to add support to GROUP BY clause However, i can use datatables following property to make it show GROUP BY DESC but it would be better if it is server side:

JavaScript

UPDATE:

As Suggested by @scaisEdge :

For 1st suggestion i changed the following:

JavaScript

TO

JavaScript

For 2nd suggestion :

removed the GROUP BY clause from ssp::complex json encode statement and

JavaScript

TO

JavaScript

works perfectly 🙂

Advertisement

Answer

two suggestion

1 ) in this code you should use string concatenation for $where

JavaScript

2 ) seems you have order by limit and offset for pagination after group by (and group by id DESC is wrong)

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement