Fixed according to *SATS* api/sync log
This commit is contained in:
parent
3914b85a36
commit
f4271043c8
|
@ -41,14 +41,18 @@
|
||||||
|
|
||||||
$mods = $get_mods->answer();
|
$mods = $get_mods->answer();
|
||||||
|
|
||||||
// si pas déja -> on ajoute l'id module à la liste
|
foreach($mods as $module){
|
||||||
if( is_array($mods) && !in_array($mods['id_module'], $module_ids) )
|
|
||||||
$module_ids[] = $mods['id_module'];
|
// si pas déja -> on ajoute l'id module à la liste
|
||||||
|
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 = [];
|
$chips = [];
|
||||||
foreach($module_ids as $module_id){
|
foreach($module_ids as $module_id){
|
||||||
|
@ -59,22 +63,16 @@
|
||||||
|
|
||||||
$fetched = $chip_req->fetch();
|
$fetched = $chip_req->fetch();
|
||||||
|
|
||||||
// only one by ids
|
foreach($fetched as $chip)
|
||||||
$chips[$fetched['id_chip']] = $fetched;
|
$chips[] = $chip;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$chip = Table::get('chip')
|
|
||||||
->join('id_module', $module_merge)
|
|
||||||
->select('*');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* [2] On retourne le résultat
|
/* [2] On retourne le résultat
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
return $chip->fetch();
|
return $chips;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
use \database\core\DatabaseDriver;
|
use \database\core\DatabaseDriver;
|
||||||
use \database\core\Repo;
|
use \database\core\Repo;
|
||||||
use \manager\repo\cluster as clusterRepo;
|
use \manager\repo\cluster as clusterRepo;
|
||||||
|
use \orm\core\Table;
|
||||||
|
|
||||||
class state extends parentRepo{
|
class state extends parentRepo{
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue