Fixed according to *SATS* api/sync log

This commit is contained in:
xdrm-brackets 2017-09-25 23:21:42 +02:00
parent 3914b85a36
commit f4271043c8
2 changed files with 12 additions and 13 deletions

View File

@ -41,14 +41,18 @@
$mods = $get_mods->answer();
foreach($mods as $module){
// si pas déja -> on ajoute l'id module à la liste
if( is_array($mods) && !in_array($mods['id_module'], $module_ids) )
$module_ids[] = $mods['id_module'];
if( !in_array($module['id_module'], $module_ids) )
$module_ids[] = $module['id_module'];
}
}
/* (3) On récupère la liste des CHIPS
/* (3) On récupère la liste des CHIPS (associés aux modules)
---------------------------------------------------------*/
$chips = [];
foreach($module_ids as $module_id){
@ -59,22 +63,16 @@
$fetched = $chip_req->fetch();
// only one by ids
$chips[$fetched['id_chip']] = $fetched;
foreach($fetched as $chip)
$chips[] = $chip;
}
$chip = Table::get('chip')
->join('id_module', $module_merge)
->select('*');
/* [2] On retourne le résultat
=========================================================*/
return $chip->fetch();
return $chips;
}
}

View File

@ -4,6 +4,7 @@
use \database\core\DatabaseDriver;
use \database\core\Repo;
use \manager\repo\cluster as clusterRepo;
use \orm\core\Table;
class state extends parentRepo{