Added new errors count to main dashboard and builds list.
This commit is contained in:
parent
eb55474ff4
commit
ce23fac283
7 changed files with 76 additions and 13 deletions
|
|
@ -143,6 +143,7 @@ class BuildErrorStore extends Store
|
|||
* @param integer $buildId
|
||||
* @param string $plugin
|
||||
* @param integer $severity
|
||||
* @param string $isNew
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
|
|
@ -295,4 +296,26 @@ class BuildErrorStore extends Store
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $buildId
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getNewErrorsCount($buildId)
|
||||
{
|
||||
$query = 'SELECT COUNT(*) AS {{total}} FROM {{build_error}} WHERE {{build_id}} = :build AND {{is_new}} = true';
|
||||
|
||||
$stmt = Database::getConnection('read')->prepareCommon($query);
|
||||
|
||||
$stmt->bindValue(':build', $buildId);
|
||||
|
||||
if ($stmt->execute()) {
|
||||
$res = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
|
||||
return (integer)$res['total'];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue