Skip to content

Commit

Permalink
menu表增加remark字段
Browse files Browse the repository at this point in the history
  • Loading branch information
windhoney committed Jul 2, 2019
1 parent c8f271b commit 3126419
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion controllers/MenuController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function actionUserMenu()

return $return;
};
$result = MenuHelper::getAssignedMenu(Yii::$app->user->id, null, $callback, Yii::$app->request->get('client'));
$result = MenuHelper::getAssignedMenu(Yii::$app->user->id, null, $callback, false, Yii::$app->request->get('client'));

return $result;
}
Expand Down
1 change: 1 addition & 0 deletions migrations/m140602_111327_create_menu_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function up()
'name' => $this->string(128)->notNull(),
'parent' => $this->integer(),
'route' => $this->string(),
'remark' => $this->string(),
'order' => $this->integer(),
'data' => $this->binary(),
"FOREIGN KEY ([[parent]]) REFERENCES {$menuTable}([[id]]) ON DELETE SET NULL ON UPDATE CASCADE",
Expand Down
4 changes: 3 additions & 1 deletion models/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function rules()
'range' => static::find()->select(['name'])->column(),
'message' => 'Menu "{value}" not found.'
],
[['parent', 'route', 'data', 'order'], 'default'],
[['parent', 'route', 'data', 'order', 'remark'], 'default'],
[
['parent'],
'filterParent',
Expand Down Expand Up @@ -134,6 +134,7 @@ public function attributeLabels()
'route' => 'route',//Yii::t('rbac-admin', 'Route'),
'order' => 'order',//Yii::t('rbac-admin', 'Order'),
'data' => 'data',//Yii::t('rbac-admin', 'Data'),
'remark' => 'remark',//Yii::t('rbac-admin', 'Data'),
];
}

Expand Down Expand Up @@ -192,6 +193,7 @@ public function getMenuSource()
'm.route',
'parent_name' => 'p.name',
'm.order',
'm.remark',
'a.description as route_name'
])
->from(['m' => $tableName])
Expand Down

0 comments on commit 3126419

Please sign in to comment.