mirror of
https://framagit.org/tykayn/date-poll-api
synced 2023-08-25 08:23:11 +02:00
set id of choice in time slice
This commit is contained in:
parent
c0791d52ac
commit
5bb76de67a
@ -301,10 +301,10 @@ class Poll {
|
|||||||
$grouped_dates[ $boom[ 0 ] ] = [
|
$grouped_dates[ $boom[ 0 ] ] = [
|
||||||
|
|
||||||
"date_string" => $boom[ 0 ],
|
"date_string" => $boom[ 0 ],
|
||||||
"time_slices" => [],
|
"choices" => [],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
$grouped_dates[ $boom[ 0 ] ][ "time_slices" ][] = [
|
$grouped_dates[ $boom[ 0 ] ][ "choices" ][] = [
|
||||||
"choice_id" => $choice->getId(),
|
"choice_id" => $choice->getId(),
|
||||||
"name" => $boom[ 1 ] ];
|
"name" => $boom[ 1 ] ];
|
||||||
}
|
}
|
||||||
@ -378,12 +378,13 @@ class Poll {
|
|||||||
$groupsOfDates = [];
|
$groupsOfDates = [];
|
||||||
foreach ( $grouped_dates as $group ) {
|
foreach ( $grouped_dates as $group ) {
|
||||||
$ii =0;
|
$ii =0;
|
||||||
foreach ( $group["time_slices"] as $slice ) {
|
foreach ( $group["choices"] as $slice ) {
|
||||||
$slice['score'] = $computedArray[ $slice['choice_id'] ]['score'];
|
$slice['score'] = $computedArray[ $slice['choice_id'] ]['score'];
|
||||||
$slice['yes'] = $computedArray[ $slice['choice_id'] ]['yes'];
|
$slice['yes'] = $computedArray[ $slice['choice_id'] ]['yes'];
|
||||||
$slice['maybe'] = $computedArray[ $slice['choice_id'] ]['maybe'];
|
$slice['maybe'] = $computedArray[ $slice['choice_id'] ]['maybe'];
|
||||||
$slice['no'] = $computedArray[ $slice['choice_id'] ]['no'];
|
$slice['no'] = $computedArray[ $slice['choice_id'] ]['no'];
|
||||||
$group["time_slices"][$ii] = $slice;
|
$slice['id'] = $slice['choice_id'];
|
||||||
|
$group["choices"][$ii] = $slice;
|
||||||
$ii++;
|
$ii++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user