Commit 6f8e46af290b7a8ea2214ebe405c2bcaa9d92114
1 parent
d8781ac5
+ fix по сливаниям веток
Showing
6 changed files
with
15 additions
and
6 deletions
Show diff stats
backend/controllers/MenuController.php
@@ -118,4 +118,5 @@ class MenuController extends Controller | @@ -118,4 +118,5 @@ class MenuController extends Controller | ||
118 | throw new NotFoundHttpException('The requested page does not exist.'); | 118 | throw new NotFoundHttpException('The requested page does not exist.'); |
119 | } | 119 | } |
120 | } | 120 | } |
121 | + | ||
121 | } | 122 | } |
backend/controllers/MenuLocationController.php
@@ -4,7 +4,7 @@ namespace backend\controllers; | @@ -4,7 +4,7 @@ namespace backend\controllers; | ||
4 | 4 | ||
5 | use Yii; | 5 | use Yii; |
6 | use backend\models\MenuLocation; | 6 | use backend\models\MenuLocation; |
7 | -use backend\models\MenuSearchLocation; | 7 | +use backend\models\MenuLocationSearch; |
8 | use yii\web\Controller; | 8 | use yii\web\Controller; |
9 | use yii\web\NotFoundHttpException; | 9 | use yii\web\NotFoundHttpException; |
10 | use yii\filters\VerbFilter; | 10 | use yii\filters\VerbFilter; |
@@ -32,7 +32,7 @@ class MenuLocationController extends Controller | @@ -32,7 +32,7 @@ class MenuLocationController extends Controller | ||
32 | */ | 32 | */ |
33 | public function actionIndex() | 33 | public function actionIndex() |
34 | { | 34 | { |
35 | - $searchModel = new MenuSearchLocation(); | 35 | + $searchModel = new MenuLocationSearch(); |
36 | $dataProvider = $searchModel->search(Yii::$app->request->queryParams); | 36 | $dataProvider = $searchModel->search(Yii::$app->request->queryParams); |
37 | 37 | ||
38 | return $this->render('index', [ | 38 | return $this->render('index', [ |
backend/controllers/TerminController.php
@@ -10,6 +10,7 @@ use yii\web\NotFoundHttpException; | @@ -10,6 +10,7 @@ use yii\web\NotFoundHttpException; | ||
10 | use yii\filters\VerbFilter; | 10 | use yii\filters\VerbFilter; |
11 | use backend\models\TerminLang; | 11 | use backend\models\TerminLang; |
12 | use backend\models\TerminStructure; | 12 | use backend\models\TerminStructure; |
13 | +use yii\filters\AccessControl; | ||
13 | 14 | ||
14 | /** | 15 | /** |
15 | * TerminController implements the CRUD actions for Termin model. | 16 | * TerminController implements the CRUD actions for Termin model. |
backend/models/Menu.php
@@ -94,4 +94,9 @@ class Menu extends \yii\db\ActiveRecord | @@ -94,4 +94,9 @@ class Menu extends \yii\db\ActiveRecord | ||
94 | ->all(); | 94 | ->all(); |
95 | */ | 95 | */ |
96 | } | 96 | } |
97 | + | ||
98 | + public function getTerminLang() | ||
99 | + { | ||
100 | + return $this->hasOne(TerminLang::className(), ['termin_id' => 'termin_id']); | ||
101 | + } | ||
97 | } | 102 | } |
backend/models/MenuSearch.php
@@ -49,7 +49,8 @@ class MenuSearch extends Menu | @@ -49,7 +49,8 @@ class MenuSearch extends Menu | ||
49 | 49 | ||
50 | $this->load($params); | 50 | $this->load($params); |
51 | 51 | ||
52 | - if (!$this->validate()) { | 52 | + if (! $this->validate()) |
53 | + { | ||
53 | // uncomment the following line if you do not want to return any records when validation fails | 54 | // uncomment the following line if you do not want to return any records when validation fails |
54 | // $query->where('0=1'); | 55 | // $query->where('0=1'); |
55 | return $dataProvider; | 56 | return $dataProvider; |
@@ -67,7 +68,7 @@ class MenuSearch extends Menu | @@ -67,7 +68,7 @@ class MenuSearch extends Menu | ||
67 | ]); | 68 | ]); |
68 | 69 | ||
69 | $query->andFilterWhere(['like', 'name', $this->name]) | 70 | $query->andFilterWhere(['like', 'name', $this->name]) |
70 | - ->andFilterWhere(['like', 'url', $this->url]); | 71 | + ->andFilterWhere(['like', 'url', $this->url]); |
71 | 72 | ||
72 | return $dataProvider; | 73 | return $dataProvider; |
73 | } | 74 | } |
backend/views/menu/index.php
@@ -28,8 +28,9 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -28,8 +28,9 @@ $this->params['breadcrumbs'][] = $this->title; | ||
28 | 28 | ||
29 | [ | 29 | [ |
30 | 'attribute' => Yii::t('app', 'termin'), | 30 | 'attribute' => Yii::t('app', 'termin'), |
31 | - 'value' => function ($model) { | ||
32 | - return empty($model->termin_id) ? '-' : $model->termin_lang->termin_title; | 31 | + 'value' => function ($model) |
32 | + { | ||
33 | + return empty ($model->termin_id) ? '-' : $model->terminLang->termin_title; | ||
33 | }, | 34 | }, |
34 | ], | 35 | ], |
35 | 'menu_pid', | 36 | 'menu_pid', |