[Rilevazioni Steup]
- Fix visualizzazioni
This commit is contained in:
@@ -19,7 +19,7 @@ class RilevazioniSteup {
|
||||
}
|
||||
|
||||
public static function getListIspezioni($filter = array()) {
|
||||
$pageNum = array_get($_GET, "pag", 1);
|
||||
$pageNum = (int)array_get($_GET, "pag", 1);
|
||||
$pageSize = 10;
|
||||
|
||||
$query = new Query;
|
||||
@@ -47,8 +47,8 @@ class RilevazioniSteup {
|
||||
|
||||
if ($activityId) {
|
||||
$activityId = is_array($activityId) ? reset($activityId) : $activityId;
|
||||
$activityId = is_array($activityId) ? implode(", ", $activityId) : $activityId;
|
||||
$query->where("activity_id", $activityId);
|
||||
$activityId = is_array($activityId) ? implode("', '", $activityId) : $activityId;
|
||||
$query->where("activity_id in ('" . $activityId . "')");
|
||||
}
|
||||
|
||||
if (array_key_exists("data", $filter) && !is_null($filter["data"])) {
|
||||
@@ -56,6 +56,7 @@ class RilevazioniSteup {
|
||||
}
|
||||
|
||||
$ret = $query->orderBy("effective_time DESC")->toRet()->execute();
|
||||
$total = 0;
|
||||
|
||||
if ($ret->is_OK()) {
|
||||
$arr_ispezioni = null;
|
||||
@@ -120,22 +121,24 @@ class RilevazioniSteup {
|
||||
|
||||
if ($isPuntoVendita) { // raggruppa x stessa data, stesso pv
|
||||
$arr_ispezioni = self::groupBy_pv_data($arr_ispezioni);
|
||||
|
||||
$ret->set_data(array_slice($arr_ispezioni, ($pageNum - 1) * $pageSize, $pageSize));
|
||||
|
||||
$pagination = new Pagination;
|
||||
$pagination
|
||||
->newMode()
|
||||
->setResultsCount($total)
|
||||
->passo($pageSize)
|
||||
->orderBy(array("effective_time" => "DESC"));
|
||||
|
||||
$ret->set("pagination", $pagination);
|
||||
} else {
|
||||
foreach ($arr_ispezioni as $i => $item) {
|
||||
$arr_ispezioni[$i]["activity_id"] = array($item["activity_id"]);
|
||||
}
|
||||
|
||||
$ret->set_data($arr_ispezioni);
|
||||
}
|
||||
|
||||
$ret->set_data(array_slice($arr_ispezioni, ($pageNum - 1) * $pageSize, $pageSize));
|
||||
|
||||
$pagination = new Pagination;
|
||||
$pagination
|
||||
->newMode()
|
||||
->setResultsCount($total)
|
||||
->passo($pageSize)
|
||||
->orderBy(array("effective_time" => "DESC"));
|
||||
|
||||
$ret->set("pagination", $pagination);
|
||||
}
|
||||
|
||||
return $ret;
|
||||
|
||||
@@ -125,14 +125,14 @@ if ($Ret->is_OK()) {
|
||||
<span class="badge badge-sm badge-warning">
|
||||
<i class="fa fa-exclamation-triangle"></i> Punteggi non assegnati
|
||||
</span>
|
||||
<?php
|
||||
} else { ?>
|
||||
<?php } else { ?>
|
||||
<span class="badge badge-sm badge-success">
|
||||
<i class="fa fa-check"></i> Conclusa
|
||||
</span>
|
||||
<?php
|
||||
}
|
||||
} else { ?>
|
||||
} else {
|
||||
?>
|
||||
<span class="badge badge-sm badge-warning">
|
||||
<i class="fa fa-exclamation-triangle"></i> Aperta
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user