Add "Last Votes by TU" list

This shows a list of all Trusted Users and the vote ID of the last
proposal each of the TUs voted on. This list is sorted by vote ID.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2013-08-26 17:29:24 +02:00
parent fb76aab8cf
commit 2dd3d04f45
3 changed files with 61 additions and 0 deletions

View file

@ -995,6 +995,25 @@ function past_proposal_list($order, $lim) {
return $details;
}
/**
* Get the vote ID of the last vote of all Trusted Users
*
* @return array The vote ID of the last vote of each Trusted User
*/
function last_votes_list() {
$dbh = DB::connect();
$q = "SELECT UserID, MAX(VoteID) AS LastVote FROM TU_Votes GROUP BY UserID ORDER BY VoteID DESC";
$result = $dbh->query($q);
$details = array();
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$details[] = $row;
}
return $details;
}
/**
* Determine the total number of Trusted User proposals
*