Fixed silly bug
Statistics for each user in user list showed comment count instead of post count.
This commit is contained in:
parent
306c6478b4
commit
b1fb329fc7
2 changed files with 10 additions and 1 deletions
|
@ -148,4 +148,13 @@ class UserEntity extends AbstractEntity
|
|||
->where('commenter_id = ?')->put($this->id);
|
||||
return Database::fetchOne($sqlQuery)['count'];
|
||||
}
|
||||
|
||||
public function getPostCount()
|
||||
{
|
||||
$sqlQuery = (new SqlQuery)
|
||||
->select('count(1)')->as('count')
|
||||
->from('post')
|
||||
->where('uploader_id = ?')->put($this->id);
|
||||
return Database::fetchOne($sqlQuery)['count'];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
<div class="date-registered">Date registered: <?php echo date('Y-m-d H:i', $user->joinDate) ?></div>
|
||||
<div class="fav-count">Favorite count: <?php echo $user->getFavoriteCount() ?></div>
|
||||
<div class="post-count">Post count: <?php echo $user->getCommentCount() ?></div>
|
||||
<div class="post-count">Post count: <?php echo $user->getPostCount() ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
|
|
Loading…
Reference in a new issue