Fixed according to *SATS* api/sync log
This commit is contained in:
parent
3914b85a36
commit
f4271043c8
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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{
|
||||
|
||||
|
|
Loading…
Reference in New Issue