Skip to content

Commit 2ed0435

Browse files
author
Igor Chepurnoy
committed
Update RbacCommand.php
1 parent 5aba6e7 commit 2ed0435

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

commands/RbacCommand.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function renderArray($array)
9090
*/
9191
public function actionSyncSave()
9292
{
93-
$authItem = (new Query())->select('name, type, description, ruleName, data')->from('AuthItem')->all();
93+
$authItem = (new Query())->select('name, type, description, rule_name, data')->from('AuthItem')->all();
9494
$authItemChild = (new Query())->select('parent, child')->from('AuthItemChild')->all();
9595
$authRule = (new Query())->select('name,data')->from('AuthRule')->all();
9696
file_put_contents($this->authItemConfig, $this->renderArray($authItem));
@@ -110,7 +110,7 @@ public function actionSyncDeploy()
110110
Yii::$app->db->createCommand()->delete('AuthItem')->execute();
111111
$authItem = require($this->authItemConfig);
112112
$insertAuthItemQuery = $queryBuilder->batchInsert('AuthItem', [
113-
'name', 'type', 'description', 'ruleName', 'data'
113+
'name', 'type', 'description', 'rule_name', 'data'
114114
], $authItem);
115115
Yii::$app->db->createCommand($insertAuthItemQuery)->execute();
116116
}
@@ -133,7 +133,7 @@ public function actionSyncDeploy()
133133
Yii::$app->db->createCommand($insertAuthRuleQuery)->execute();
134134
}
135135
Yii::$app->db->createCommand("SET FOREIGN_KEY_CHECKS=1;")->execute();
136-
Yii::$app->db->createCommand("DELETE aa FROM `AuthAssignment` aa LEFT JOIN AuthItem ai ON(aa.itemName = ai.name) WHERE ai.name IS NULL;")->execute();
136+
Yii::$app->db->createCommand("DELETE aa FROM `AuthAssignment` aa LEFT JOIN AuthItem ai ON(aa.item_name = ai.name) WHERE ai.name IS NULL;")->execute();
137137
}
138138

139-
}
139+
}

0 commit comments

Comments
 (0)