@@ -90,7 +90,7 @@ public function renderArray($array)
90
90
*/
91
91
public function actionSyncSave ()
92
92
{
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 ();
94
94
$ authItemChild = (new Query ())->select ('parent, child ' )->from ('AuthItemChild ' )->all ();
95
95
$ authRule = (new Query ())->select ('name,data ' )->from ('AuthRule ' )->all ();
96
96
file_put_contents ($ this ->authItemConfig , $ this ->renderArray ($ authItem ));
@@ -110,7 +110,7 @@ public function actionSyncDeploy()
110
110
Yii::$ app ->db ->createCommand ()->delete ('AuthItem ' )->execute ();
111
111
$ authItem = require ($ this ->authItemConfig );
112
112
$ insertAuthItemQuery = $ queryBuilder ->batchInsert ('AuthItem ' , [
113
- 'name ' , 'type ' , 'description ' , 'ruleName ' , 'data '
113
+ 'name ' , 'type ' , 'description ' , 'rule_name ' , 'data '
114
114
], $ authItem );
115
115
Yii::$ app ->db ->createCommand ($ insertAuthItemQuery )->execute ();
116
116
}
@@ -133,7 +133,7 @@ public function actionSyncDeploy()
133
133
Yii::$ app ->db ->createCommand ($ insertAuthRuleQuery )->execute ();
134
134
}
135
135
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 ();
137
137
}
138
138
139
- }
139
+ }
0 commit comments