From 2dd3d04f45f8a0e57f0c8686a12d7b95fe5bdb59 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Mon, 26 Aug 2013 17:29:24 +0200 Subject: 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 --- web/lib/acctfuncs.inc.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'web/lib/acctfuncs.inc.php') diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php index 31cdd79..f52dfc3 100644 --- a/web/lib/acctfuncs.inc.php +++ b/web/lib/acctfuncs.inc.php @@ -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 * -- cgit v1.2.3-70-g09d2