Blame view

backend/controllers/CallController.php 811 Bytes
54f2fc2b   Alexey Boroda   first commit
1
2
3
4
  <?php
      
      namespace backend\controllers;
      
1ec8d36c   Alexey Boroda   -Searching applied
5
6
      use common\models\Call;
      use yii\data\ActiveDataProvider;
54f2fc2b   Alexey Boroda   first commit
7
8
9
10
11
      use yii\rest\ActiveController;
      
      class CallController extends ActiveController
      {
          public $modelClass = 'common\models\Call';
1ec8d36c   Alexey Boroda   -Searching applied
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
          
          public function actionSearch($word)
          {
              return new ActiveDataProvider(
                  [
                      'query' => Call::find()
                                     ->filterWhere(
                                         [
                                             'ilike',
                                             'company',
                                             trim($word),
                                         ]
                                     ),
                  ]
              );
          }
54f2fc2b   Alexey Boroda   first commit
28
      }