public static function getItemById($id) { if ($id == 0) { } $item = KxAdminRole::findFirst($id); return $item->toArray(); }
/** * @param $adminUid * Create a new Admin user */ public function updateAction($adminUid) { $roles = KxAdminRole::find()->toArray(); $item = KxAdminUser::getItemById($adminUid); $data = array('i' => $item, 'roles' => $roles); $views = [['name' => '编辑管理员', "template" => "kxadminuser/edit"]]; parent::showTabViews($views, '管理员管理', $data); }
/** * @param $id * @ajax * @comment: 删除角色 access_status = 0; */ public function deleteAction($id) { $item = KxAdminRole::findFirst($id); $item->access_status = 0; $deleted = $item->save(); parent::result(array('id' => $id, 'deleted' => $deleted)); }