This commit is contained in:
Naomi 2013-08-02 11:19:46 -04:00
parent 6e43094d10
commit b480a5ae18
1 changed files with 14 additions and 14 deletions

View File

@ -189,19 +189,19 @@ class Application_Service_HistoryService
} }
//need to count the total rows to tell Datatables. //need to count the total rows to tell Datatables.
$stmt = $this->con->prepare($mainSqlQuery); $stmt = $this->con->prepare($mainSqlQuery);
foreach ($paramMap as $param => $v) { foreach ($paramMap as $param => $v) {
$stmt->bindValue($param, $v); $stmt->bindValue($param, $v);
} }
if ($stmt->execute()) { if ($stmt->execute()) {
$totalRows = $stmt->rowCount(); $totalRows = $stmt->rowCount();
Logging::info("Total Rows {$totalRows}"); Logging::info("Total Rows {$totalRows}");
} }
else { else {
$msg = implode(',', $stmt->errorInfo()); $msg = implode(',', $stmt->errorInfo());
Logging::info($msg); Logging::info($msg);
throw new Exception("Error: $msg"); throw new Exception("Error: $msg");
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@ -242,13 +242,13 @@ class Application_Service_HistoryService
} }
$displayLength = intval($opts["iDisplayLength"]); $displayLength = intval($opts["iDisplayLength"]);
//limit the results returned. //limit the results returned.
if ($displayLength !== -1) { if ($displayLength !== -1) {
$mainSqlQuery.= $mainSqlQuery.=
" OFFSET :offset LIMIT :limit"; " OFFSET :offset LIMIT :limit";
$paramMap["offset"] = $opts["iDisplayStart"]; $paramMap["offset"] = $opts["iDisplayStart"];
$paramMap["limit"] = $displayLength; $paramMap["limit"] = $displayLength;
} }
$stmt = $this->con->prepare($mainSqlQuery); $stmt = $this->con->prepare($mainSqlQuery);