fix empty column export csv

This commit is contained in:
osaajani 2020-06-14 00:46:51 +02:00
parent 65a243b7b4
commit b9863a8397
1 changed files with 2 additions and 12 deletions

View File

@ -260,10 +260,7 @@ namespace controllers\internals;
{
$contacts = $this->get_model()->gets_for_user($id_user);
$columns = [
'contact_name',
'contact_number',
];
$columns = [0, 1];
foreach ($contacts as $contact)
{
@ -280,16 +277,9 @@ namespace controllers\internals;
{
$datas = json_decode($contact['datas'], true);
$line = [];
$line = [$contact['name'], $contact['number']];
foreach ($columns as $column)
{
if (isset($contact[$column]))
{
$line[] = $contact[$column];
continue;
}
if (isset($datas[$column]))
{
$line[] = $datas[$column];