Change all lists to use ajax data source and high perf datatable + improve all consuming listing queries + add indexes on numbers for perf improvment

This commit is contained in:
osaajani 2020-09-23 03:02:13 +02:00
parent 52ac5b459b
commit b98d5a22ef
34 changed files with 1238 additions and 767 deletions

View file

@ -39,8 +39,22 @@ namespace controllers\publics;
*/
public function list()
{
$smsstops = $this->internal_sms_stop->list_for_user($_SESSION['user']['id']);
$this->render('smsstop/list', ['smsstops' => $smsstops, 'nb_results' => \count($smsstops)]);
$this->render('smsstop/list');
}
/**
* Return smsstops as json
*/
public function list_json()
{
$entities = $this->internal_sms_stop->list_for_user($_SESSION['user']['id']);
foreach ($entities as &$entity)
{
$entity['number_formatted'] = \controllers\internals\Tool::phone_link($entity['number']);
}
header('Content-Type: application/json');
echo json_encode(['data' => $entities]);
}
/**