Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Jul 3, 2016
1 parent 744839f commit 8d8121d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions block/role/Manageredit.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public function save(){

}


# 保存编辑后的Role内容 AdminRole
# 以及role对应的菜单表 AdminRoleMenu
public function saveMenuAndRole(){
Expand All @@ -136,7 +137,6 @@ public function saveMenuAndRole(){
$this->_one->save();
$roleId = Yii::$app->db->getLastInsertID();
}

$menu = CRequest::param("menu");
$select_menus = isset($menu['select_menus']) ? $menu['select_menus'] : '';
# 如果存在role_id 和选择的菜单
Expand Down Expand Up @@ -168,14 +168,21 @@ public function saveMenuAndRole(){
if(!empty($add_role_menu_ids)){
\fec\helpers\CDB::batchInsert($table,$columnsArr,$valueArr);
}
AdminRoleMenu::deleteAll(['in','menu_id',$remove_role_menu_ids]);
if(!empty($remove_role_menu_ids)){
$remove_role_menu_id_str = implode(',',$remove_role_menu_ids);
$table = AdminRoleMenu::tableName();
$sql = "delete from $table where menu_id in ($remove_role_menu_id_str ) and role_id = :role_id ";
$data = [ 'role_id'=> $roleId ];
CDB::deleteBySql($sql,$data);
}
$innerTransaction->commit();
} catch (Exception $e) {
$innerTransaction->rollBack();
}
}
}


# 得到当前数据库中role对应的所有的menu_id
public function getDbRoleMenuIds($roleId){
$role_menu_ids = [];
Expand Down
2 changes: 1 addition & 1 deletion myassets/DwzIE9Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class DwzIE9Asset extends AssetBundle
{
public $sourcePath = '@fecadmin/myassets';

//public $cssOptions = ['condition' => 'lte IE9'];
public $jsOptions = [
'position' => \yii\web\View::POS_HEAD ,
'condition' => 'lt IE 9'
Expand Down

0 comments on commit 8d8121d

Please sign in to comment.