Added favmax: (consistency with datemax:)
This commit is contained in:
parent
28c1ce68b4
commit
9e73d0de91
1 changed files with 3 additions and 1 deletions
|
@ -633,13 +633,15 @@ class PostController
|
||||||
switch ($key)
|
switch ($key)
|
||||||
{
|
{
|
||||||
case 'favmin':
|
case 'favmin':
|
||||||
|
case 'favmax':
|
||||||
|
$operator = $key == 'favmin' ? '>=' : '<=';
|
||||||
$dbQuery
|
$dbQuery
|
||||||
->open()
|
->open()
|
||||||
->select('COUNT(1)')
|
->select('COUNT(1)')
|
||||||
->from('favoritee')
|
->from('favoritee')
|
||||||
->where('post_id = post.id')
|
->where('post_id = post.id')
|
||||||
->close()
|
->close()
|
||||||
->addSql('>= ?')->put(intval($val));
|
->addSql($operator . ' ?')->put(intval($val));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'type':
|
case 'type':
|
||||||
|
|
Loading…
Reference in a new issue