This commit is contained in:
Marcin Kurczewski 2013-10-27 22:55:14 +01:00
parent 2f8d43cb4b
commit 558f8f42c8

View file

@ -826,11 +826,24 @@ class PostController
switch ($key) switch ($key)
{ {
case 'id':
$ids = preg_split('/[;,]/', $val);
$ids = array_map('intval', $ids);
$dbQuery->$andFunc('id')->in('(' . R::genSlots($ids) . ')');
foreach ($ids as $id)
$dbQuery->put($id);
break;
case 'idmin':
case 'idmax':
$operator = $key == 'idmin' ? '>=' : '<=';
$dbQuery->$andFunc('id ' . $operator . ' ?')->put(intval($val));
break;
case 'favmin': case 'favmin':
case 'favmax': case 'favmax':
$operator = $key == 'favmin' ? '>=' : '<='; $operator = $key == 'favmin' ? '>=' : '<=';
$dbQuery $dbQuery->$andFunc('fav_count ' . $operator . ' ?')->put(intval($val));
->$andFunc('fav_count ' . $operator . ' ?')->put(intval($val));
break; break;
case 'type': case 'type':