search fix

This commit is contained in:
andrey 2021-08-05 14:08:00 +03:00
parent c522278222
commit 76377f5f1b
3 changed files with 11 additions and 1 deletions

View File

@ -6,6 +6,7 @@ use common\behaviors\GsCors;
use common\classes\Debug; use common\classes\Debug;
use common\models\InterviewRequest; use common\models\InterviewRequest;
use frontend\modules\api\models\ProfileSearchForm; use frontend\modules\api\models\ProfileSearchForm;
use yii\filters\auth\QueryParamAuth;
class ProfileController extends \yii\rest\Controller class ProfileController extends \yii\rest\Controller
{ {
@ -19,6 +20,10 @@ class ProfileController extends \yii\rest\Controller
'application/json' => \yii\web\Response::FORMAT_JSON, 'application/json' => \yii\web\Response::FORMAT_JSON,
], ],
], ],
'authenticatior' => [
'class' => QueryParamAuth::class, //implement access token authentication
'except' => ['login'], // no need to verify the access token method, pay attention to distinguish between $noAclLogin
],
'corsFilter' => [ 'corsFilter' => [
'class' => GsCors::class, 'class' => GsCors::class,
'cors' => [ 'cors' => [

View File

@ -5,6 +5,7 @@ namespace frontend\modules\api\controllers;
use common\behaviors\GsCors; use common\behaviors\GsCors;
use common\models\Options; use common\models\Options;
use yii\filters\AccessControl; use yii\filters\AccessControl;
use yii\filters\auth\QueryParamAuth;
class SkillsController extends \yii\rest\Controller class SkillsController extends \yii\rest\Controller
{ {
@ -17,6 +18,10 @@ class SkillsController extends \yii\rest\Controller
'application/json' => \yii\web\Response::FORMAT_JSON, 'application/json' => \yii\web\Response::FORMAT_JSON,
], ],
], ],
'authenticatior' => [
'class' => QueryParamAuth::class, //implement access token authentication
'except' => ['login'], // no need to verify the access token method, pay attention to distinguish between $noAclLogin
],
'corsFilter' => [ 'corsFilter' => [
'class' => GsCors::class, 'class' => GsCors::class,
'cors' => [ 'cors' => [

View File

@ -72,7 +72,7 @@ class ProfileSearchForm extends Model
$model->groupBy('card_skill.card_id'); $model->groupBy('card_skill.card_id');
return $model->limit($this->limit) return $model->limit($this->limit)
->offset($this->offset)->orderBy('id DESC')->asArray()->all(); ->offset($this->offset)->orderBy('updated_at DESC')->asArray()->all();
} }
} }