Speedup appData::objectGetEntriesCount() when selecting un-queued entries or we are an admin.
This commit is contained in:
committed by
WineHQ
parent
e666a5c52e
commit
9ad365e1bd
@@ -203,45 +203,55 @@ class appData
|
|||||||
$sQuery .= " AND type = '?'";
|
$sQuery .= " AND type = '?'";
|
||||||
$hResult = query_parameters($sQuery, $_SESSION['current']->iUserId,
|
$hResult = query_parameters($sQuery, $_SESSION['current']->iUserId,
|
||||||
$sType);
|
$sType);
|
||||||
} else {
|
} else
|
||||||
|
{
|
||||||
$hResult = query_parameters($sQuery, $_SESSION['current']->iUserId);
|
$hResult = query_parameters($sQuery, $_SESSION['current']->iUserId);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
$sQuery = "SELECT COUNT(DISTINCT appData.id) as count FROM appData,
|
if($sQueued == "true" || $sQueued == "false")
|
||||||
|
$sAppDataQueued = " AND appData.queued = '$sQueued'";
|
||||||
|
|
||||||
|
if($sType)
|
||||||
|
$sSelectType = " AND type = '?'";
|
||||||
|
|
||||||
|
$sQuery = "(SELECT COUNT(DISTINCT appData.id) as count FROM appData,
|
||||||
appFamily, appVersion WHERE
|
appFamily, appVersion WHERE
|
||||||
appFamily.appId = appVersion.appId
|
appFamily.appId = appVersion.appId
|
||||||
AND
|
AND
|
||||||
(
|
(
|
||||||
appData.appId = appFamily.appId
|
appData.appId = appFamily.appId
|
||||||
OR
|
)
|
||||||
|
AND
|
||||||
|
appVersion.queued = 'false'
|
||||||
|
AND
|
||||||
|
appFamily.queued = 'false'$sAppDataQueued$sSelectType) UNION
|
||||||
|
(
|
||||||
|
SELECT COUNT(DISTINCT appData.id) as count FROM appData,
|
||||||
|
appFamily, appVersion WHERE
|
||||||
|
appFamily.appId = appVersion.appId
|
||||||
|
AND
|
||||||
|
(
|
||||||
appData.versionId = appVersion.versionId
|
appData.versionId = appVersion.versionId
|
||||||
)
|
)
|
||||||
AND
|
AND
|
||||||
appVersion.queued = 'false'
|
appVersion.queued = 'false'
|
||||||
AND
|
AND
|
||||||
appFamily.queued = 'false'";
|
appFamily.queued = 'false'$sAppDataQueued$sSelectType)";
|
||||||
|
|
||||||
if($sQueued == "true" || $sQueued == "false")
|
|
||||||
$sQuery .= " AND appData.queued = '$sQueued'";
|
|
||||||
|
|
||||||
|
|
||||||
if($sType)
|
if($sType)
|
||||||
{
|
$hResult = query_parameters($sQuery, $sType, $sType);
|
||||||
$sQuery .= " AND type = '?'";
|
else
|
||||||
$hResult = query_parameters($sQuery, $sType);
|
|
||||||
} else
|
|
||||||
$hResult = query_parameters($sQuery);
|
$hResult = query_parameters($sQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if(!$oRow = mysql_fetch_object($hResult))
|
for($iCount = 0; $oRow = mysql_fetch_object($hResult);)
|
||||||
return FALSE;
|
$iCount += $oRow->count;
|
||||||
|
|
||||||
return $oRow->count;
|
|
||||||
|
|
||||||
|
return $iCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
function objectGetHeader($sType)
|
function objectGetHeader($sType)
|
||||||
|
|||||||
Reference in New Issue
Block a user