Re-add count of votes in polls admin page
This commit is contained in:
parent
f6a7a1c7bb
commit
cbad43614d
@ -283,7 +283,12 @@ class FramaDB {
|
||||
*/
|
||||
public function findAllPolls($start, $limit) {
|
||||
// Polls
|
||||
$prepared = $this->prepare('SELECT * FROM ' . Utils::table('poll') . ' ORDER BY title ASC LIMIT :start, :limit');
|
||||
$prepared = $this->prepare('
|
||||
SELECT p.*,
|
||||
(SELECT count(1) FROM ' . Utils::table('vote') . ' v WHERE p.id=v.poll_id) votes
|
||||
FROM ' . Utils::table('poll') . ' p
|
||||
ORDER BY p.title ASC
|
||||
LIMIT :start, :limit');
|
||||
$prepared->bindParam(':start', $start, PDO::PARAM_INT);
|
||||
$prepared->bindParam(':limit', $limit, PDO::PARAM_INT);
|
||||
$prepared->execute();
|
||||
|
@ -52,7 +52,7 @@
|
||||
{else}
|
||||
<td><span class="text-danger">{strtotime($poll->end_date)|date_format:'d/m/Y'}</span></td>
|
||||
{/if}
|
||||
<td>TODO</td>
|
||||
<td>{$poll->votes|html}</td>
|
||||
<td>{$poll->id|html}</td>
|
||||
<td><a href="{$poll->id|poll_url|html}" class="btn btn-link" title="{_('See the poll')}"><span class="glyphicon glyphicon-eye-open"></span><span class="sr-only">{_('See the poll')}</span></a></td>
|
||||
<td><a href="{$poll->admin_id|poll_url:true|html}" class="btn btn-link" title="{_('Change the poll')}"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{_('Change the poll')}</span></a></td>
|
||||
|
Loading…
Reference in New Issue
Block a user