Batch Routing / Consolidated: change the queries to the APP_CACHE_VIEW
This commit is contained in:
dheeyi william
2017-01-16 17:31:46 -04:00
parent 19df66a04b
commit b277816b3d
3 changed files with 95 additions and 173 deletions

View File

@@ -1,43 +0,0 @@
<?php
class Library
{
public static function getCasesNumRec($userUid)
{
$cnn = Propel::getConnection("workflow");
$stmt = $cnn->createStatement();
//Number of records active
$criteria = new Criteria("workflow");
//SELECT
$criteria->addSelectColumn(CaseConsolidatedCorePeer::CON_STATUS);
//FROM
//WHERE
$criteria->add(CaseConsolidatedCorePeer::CON_STATUS, "ACTIVE");
$activeNumRec = CaseConsolidatedCorePeer::doCount($criteria);
//Number of records
$numRec = 0;
$sql = "SELECT COUNT(APP_CACHE_VIEW.TAS_UID) AS NUMREC
FROM CASE_CONSOLIDATED
LEFT JOIN APP_CACHE_VIEW ON (CASE_CONSOLIDATED.TAS_UID = APP_CACHE_VIEW.TAS_UID)
WHERE APP_CACHE_VIEW.USR_UID = '$userUid' AND
APP_CACHE_VIEW.DEL_THREAD_STATUS = 'OPEN' AND
APP_CACHE_VIEW.APP_STATUS = 'TO_DO'";
$rsSql = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
while ($rsSql->next()) {
$row = $rsSql->getRow();
$numRec = $row["NUMREC"];
}
$numRec = ($activeNumRec > 0)? $numRec : 0;
return $numRec;
}
}