Subversion Repository Public Repository

Nextrek

Diff Revisions 605 vs 607 for /Android/SmartCharging/endPoints/repositories/LocalRepository.php

Diff revisions: vs.
  @@ -304,6 +304,17 @@
304 304 $local->sito = $rowLocal["sito"];
305 305 $local->n_punti_ricarica = $rowLocal["n_punti_ricarica"];
306 306
307 + $sqlStelle = "SELECT avg(commenti.voto) as stelle
308 + FROM commenti
309 + WHERE commenti.id_locale=".$id_local."
310 + GROUP BY commenti.id_locale";
311 +
312 + //echo "<br/>".$sqlStelle."<br/>";
313 +
314 + $resultStelle = $this->db->query($sqlStelle);
315 +
316 + $local->stelle = ($resultStelle->rowCount()>0) ? $resultStelle->fetchColumn() : 0;
317 +
307 318 return $local;
308 319
309 320 } catch (PDOException $e) {