|
|
@@ -5,12 +5,11 @@ namespace app\models;
|
|
|
class Anime extends \lithium\data\Model {
|
|
|
protected $_meta = array('key' => '_id', 'source' => 'anime');
|
|
|
|
|
|
- public static function search($query, $page = 1, $by = 'title')
|
|
|
- {
|
|
|
+ public static function search($query, $page = 1, $by = 'title')
|
|
|
+ {
|
|
|
$defaults = array(
|
|
|
'limit' => 20
|
|
|
);
|
|
|
-
|
|
|
$limit = 20;
|
|
|
|
|
|
$content = self::find('all',
|
|
|
@@ -21,6 +20,7 @@ class Anime extends \lithium\data\Model {
|
|
|
'limit' => $limit,
|
|
|
'page' => $page
|
|
|
));
|
|
|
+
|
|
|
$total = Anime::count(array('title' => array('like' => $query)));
|
|
|
return compact('content', 'by', 'limit', 'total', 'page');
|
|
|
}
|