minmod
This commit is contained in:
parent
f15db0a3a9
commit
97c7b8474b
|
@ -499,17 +499,17 @@
|
|||
$chips = ($chipsReq->error->get()==Err::Success) ? $chipsReq->answer() : [];
|
||||
|
||||
|
||||
foreach($chips as $c=>$chip){
|
||||
foreach($chips as &$chip){
|
||||
/* [5] On récupére la liste des PINS de chaque PUCE
|
||||
=========================================================*/
|
||||
$chips[$c]['pins'] = explode(',', $chip['pins']);
|
||||
$chip['pins'] = explode(',', $chip['pins']);
|
||||
|
||||
if( !is_array($chip['pins']) )
|
||||
$chips[$c]['pins'] = [];
|
||||
$chip['pins'] = [];
|
||||
|
||||
/* [6] On récupère valeurs pour chaque état de chaque PUCE
|
||||
=========================================================*/
|
||||
$chips[$c]['states'] = [];
|
||||
$chip['states'] = [];
|
||||
|
||||
$statesReq = new Repo('state/getForChip', [$chip['id_chip']]);
|
||||
$states = ($statesReq->error->get()==Err::Success) ? $statesReq->answer() : [];
|
||||
|
@ -517,9 +517,10 @@
|
|||
// On met en forme les données : "val1,val2,val3" -> [val1, val2, val3]
|
||||
foreach($states as $s=>$state){
|
||||
|
||||
$chips[$c]['states'][$state['state']] = explode(',', $state['value']);
|
||||
foreach($chips[$c]['states'][$state['state']] as $s2=>$state2)
|
||||
$chips[$c]['states'][$state['state']][$s2] = intval($state2);
|
||||
$chip['states'][$state['state']] = explode(',', $state['value']);
|
||||
|
||||
foreach($chip['states'][$state['state']] as $s2=>$state2)
|
||||
$chip['states'][$state['state']][$s2] = intval($state2);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -61,9 +61,9 @@
|
|||
->select('*')
|
||||
->whereIdModule($module_id);
|
||||
|
||||
$fetched = $chip_req->fetch();
|
||||
$chip_fetched = $chip_req->fetch();
|
||||
|
||||
foreach($fetched as $chip)
|
||||
foreach($chip_fetched as $chip)
|
||||
$chips[] = $chip;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue