I created a read data to retrieve an ordered list of results based on an aggregate field count, something like
I add a paginator to the event but the number of pages is wrong, it is based on the number of fields of the table instead of the number of grouped results.
Here is what's in the debugger:
[pre] [read_table] => Array
([br] [log] => Array[br] ([br] [0] => SELECT COUNT(`Call`.`aid`) AS `Call.count` [br]FROM `ta01_chronoforms_data_calls` AS `Call` [br]WHERE `Call`.`customer` = 'aCustomer' [br]AND `Call`.`date` >= '2019-02-01' [br]AND `Call`.`date` <= '2019-02-28' [br]AND `Call`.`DID_number` = '';[br] [1] => SELECT COUNT(`Call`.`caller`) AS `Call.calls`, [br]`Call`.`caller` AS `Call.internal`, [br]SUM(`Call`.`duration`) AS `Call.duration` [br]FROM `ta01_chronoforms_data_calls` AS `Call` [br]WHERE `Call`.`customer` = 'aCustomer' [br]AND `Call`.`date` >= '2019-02-01' [br]AND `Call`.`date` <= '2019-02-28' [br]AND `Call`.`DID_number` = ''[br] GROUP BY `Call`.`caller` ORDER BY `Call.calls` DESC LIMIT 20;
)[/pre]
Should I set the read data in a particular way to get the right results?
Thank you
maxx[br]
Select item, count(item) from table, group by item order by count(item)The read data is set to display all data, paging is enabled, page limit is set to 20.
I add a paginator to the event but the number of pages is wrong, it is based on the number of fields of the table instead of the number of grouped results.
Here is what's in the debugger:
[pre] [read_table] => Array
([br] [log] => Array[br] ([br] [0] => SELECT COUNT(`Call`.`aid`) AS `Call.count` [br]FROM `ta01_chronoforms_data_calls` AS `Call` [br]WHERE `Call`.`customer` = 'aCustomer' [br]AND `Call`.`date` >= '2019-02-01' [br]AND `Call`.`date` <= '2019-02-28' [br]AND `Call`.`DID_number` = '';[br] [1] => SELECT COUNT(`Call`.`caller`) AS `Call.calls`, [br]`Call`.`caller` AS `Call.internal`, [br]SUM(`Call`.`duration`) AS `Call.duration` [br]FROM `ta01_chronoforms_data_calls` AS `Call` [br]WHERE `Call`.`customer` = 'aCustomer' [br]AND `Call`.`date` >= '2019-02-01' [br]AND `Call`.`date` <= '2019-02-28' [br]AND `Call`.`DID_number` = ''[br] GROUP BY `Call`.`caller` ORDER BY `Call.calls` DESC LIMIT 20;
)[/pre]
Should I set the read data in a particular way to get the right results?
Thank you
maxx[br]