OKyJIucT
10/25/2015 - 3:03 PM

ПОлнотекстовый поиск

ПОлнотекстовый поиск

$dataProvider = new ActiveDataProvider([
    'query' => Ads::find()
        ->where('MATCH (title,text) AGAINST (:query)', [':query' => $url['query']])
        ->andWhere($region)
        ->andWhere($city)
        ->andWhere($category)
        ->with(['city', 'category', 'region'])
        ->addParams($regionParams)
        ->addParams($cityParams)
        ->addParams($categoryParams)
        ->limit(10),
    'pagination' => [
        'pageSize' => 10,
    ],
    'totalCount' => 10,
]);