1
0
mirror of https://framagit.org/tykayn/date-poll-api synced 2023-08-25 08:23:11 +02:00

fix count for no sub time slice on day

This commit is contained in:
Tykayn 2021-05-01 23:30:06 +02:00 committed by tykayn
parent 60207dc361
commit f4427dcd77

View File

@ -295,6 +295,8 @@ class Poll {
foreach ( $this->getChoices() as $choice ) { foreach ( $this->getChoices() as $choice ) {
$boom = explode( ' >>> ', $choice->getName() ); $boom = explode( ' >>> ', $choice->getName() );
if(count($boom) ==2){
if ( ! isset( $grouped_dates[ $boom[ 0 ] ] ) ) { if ( ! isset( $grouped_dates[ $boom[ 0 ] ] ) ) {
@ -307,6 +309,7 @@ class Poll {
$grouped_dates[ $boom[ 0 ] ][ "choices" ][] = [ $grouped_dates[ $boom[ 0 ] ][ "choices" ][] = [
"choice_id" => $choice->getId(), "choice_id" => $choice->getId(),
"name" => $boom[ 1 ] ]; "name" => $boom[ 1 ] ];
}
} }
} }
$scoreInfos = [ $scoreInfos = [