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

@ -42,15 +42,18 @@ namespace controllers\publics;
*/
public function list()
{
$groups = $this->internal_group->list_for_user($_SESSION['user']['id']);
foreach ($groups as $key => $group)
{
$contacts = $this->internal_group->get_contacts($group['id']);
$groups[$key]['nb_contacts'] = \count($contacts);
}
$this->render('group/list', ['groups' => $groups]);
$this->render('group/list');
}
/**
* Return groups as json
*/
public function list_json()
{
$entities = $this->internal_group->list_for_user($_SESSION['user']['id']);
header('Content-Type: application/json');
echo json_encode(['data' => $entities]);
}
/**