Update phone to use name instead of number and update sended to use phone id instead of origin

This commit is contained in:
osaajani 2020-03-31 01:19:21 +02:00
parent 62c7f69395
commit d5be760843
12 changed files with 91 additions and 93 deletions

View file

@ -44,6 +44,23 @@ namespace controllers\publics;
$page = (int) $page;
$limit = 25;
$sendeds = $this->internal_sended->list_for_user($_SESSION['user']['id'], $limit, $page);
foreach ($sendeds as &$sended)
{
if ($sended['id_phone'] === null)
{
continue;
}
$phone = $this->internal_phone->get_for_user($_SESSION['user']['id'], $sended['id_phone']);
if (!$phone)
{
continue;
}
$sended['phone_name'] = $phone['name'];
}
$this->render('sended/list', ['sendeds' => $sendeds, 'page' => $page, 'limit' => $limit, 'nb_results' => \count($sendeds)]);
}