Commit fba123c8db5a0f54e09dabe792e965e13f70ca73
1 parent
c20d5820
test
Showing
2 changed files
with
14 additions
and
7 deletions
Show diff stats
backend/config/main.php
| ... | ... | @@ -13,7 +13,14 @@ return [ |
| 13 | 13 | 'id' => 'app-backend', |
| 14 | 14 | 'basePath' => dirname(__DIR__), |
| 15 | 15 | 'controllerNamespace' => 'backend\controllers', |
| 16 | - 'bootstrap' => ['log'], | |
| 16 | + 'bootstrap' => [ | |
| 17 | + 'log', | |
| 18 | + function() { | |
| 19 | + if(!\Yii::$app->user->can('viewAdmin')) { | |
| 20 | + return \Yii::$app->response->redirect('/'); | |
| 21 | + } | |
| 22 | + } | |
| 23 | + ], | |
| 17 | 24 | 'modules' => [ |
| 18 | 25 | 'permit' => [ |
| 19 | 26 | 'class' => 'developeruz\db_rbac\Yii2DbRbac', | ... | ... |
frontend/models/SearchPerformerForm.php
| ... | ... | @@ -242,18 +242,18 @@ |
| 242 | 242 | 'or', |
| 243 | 243 | [ |
| 244 | 244 | 'like', |
| 245 | - 'user.firstname', | |
| 246 | - $this->search, | |
| 245 | + 'LOWER("user"."firstname")', | |
| 246 | + mb_strtolower($this->search), | |
| 247 | 247 | ], |
| 248 | 248 | [ |
| 249 | 249 | 'like', |
| 250 | - 'user.lastname', | |
| 251 | - $this->search, | |
| 250 | + 'LOWER("user"."lastname")', | |
| 251 | + mb_strtolower($this->search), | |
| 252 | 252 | ], |
| 253 | 253 | [ |
| 254 | 254 | 'like', |
| 255 | - 'company_info.name', | |
| 256 | - $this->search, | |
| 255 | + 'LOWER("company_info"."name")', | |
| 256 | + mb_strtolower($this->search), | |
| 257 | 257 | ], |
| 258 | 258 | ]); |
| 259 | 259 | } | ... | ... |