/** * List all roles */ public function indexAction() { $result = KxAdminRole::search($_GET); $items = array(); if ($result['items']) { $items = $result['items']->toArray(); } foreach ($items as &$item) { $item['status'] = $item['status'] == 1 ? "正常" : "停用"; } $data = array('item_has_checkbox' => true, 'item_has_operator' => true, 'headers' => KxAdminRole::headers(), 'count' => $result['count'], 'items' => $items, 'target_field' => 'role_id'); $views = [['name' => '管理员角色列表', "template" => "kxadminrole/list"]]; parent::showTabViews($views, '管理员角色管理', $data); }