operatorData = $this->getUser (); $this->objDPlatform = new Platform (); } /** * 默认 */ public function doDefault() { } /** * 页面: "平台信息"列表 * 地址:http://cas.lishuy.com/?c=Admin_Platform_Index&a=PageList */ public function doPageList() { $page = Request::varGetInt ( 'page', 1 ); $size = 10; $offset = ($page - 1) * $size; $limit = "{$offset},{$size}"; $condition = array (); $total_num = $this->objDPlatform->totals ( $condition ); $url_tpl = Request::schemeDomain () . "?c=Admin_Platform_Index&a=PageList"; $url_tpl .= "&page={page}"; $objPage = new Page ( $total_num, $url_tpl, $page, $size ); $page_html = $objPage->html (); $order = 'id desc'; $ids = $this->objDPlatform->findIdsBy ( $condition, $limit, $order ); $platformData = $this->objDPlatform->gets ( $ids ); $this->tpl = 'admin/platform/list'; $title = '平台列表'; $this->setOutput('title', $title); $this->setOutput('menu_active', array('name' => 'platformlist', 'item' => 'list')); //激活菜单 $this->addNavMenu('平台设置'); $this->addNavMenu($title); $this->setOutput('pagePublicData', $this->getPagePublicData()); // 后台管理相关数据 $this->setOutput ( 'page_html', $page_html ); // 分页Html $this->setOutput ( 'platformData', $platformData ); // 当前"平台信息"列表数据 } /** * 页面: 查看&修改 "平台信息" * 地址:http://cas.lishuy.com/?c=Admin_Platform_Index&a=PageShow&id=nn * 参数:id "平台信息"id */ public function doPageShow() { $id = Request::g ( 'id' ); $platformData = $this->objDPlatform->get ( $id ); $this->tpl = 'admin/platform/edit'; $title = '编辑平台信息'; $this->setOutput('title', $title); $this->setOutput('menu_active', array('name' => 'platformset', 'item' => 'list')); //激活菜单 $this->addNavMenu('平台设置'); $this->addNavMenu('平台列表', Request::schemeDomain() . '/?c=Admin_Platform_index&a=PageList'); $this->addNavMenu($title); $this->setOutput('pagePublicData', $this->getPagePublicData()); // 后台管理相关数据 $this->setOutput ( 'platformData', $platformData ); // 当前"平台信息"内容 } /** * 事件:创建"平台信息" * 地址:http://cas.lishuy.com/index.php?c=Admin_Platform_Index&a=ReqCreate * 参数:见方法内 */ public function doReqCreate() { $tableInfo = $_POST; $operator_uid = $this->operatorData ['uid']; $info = array_merge($tableInfo, array( 'operator_uid' => $operator_uid )); $tmpResult = $this->objDPlatform->thisAdd ( $info ); if (!$tmpResult) { $this->ajax_fail_exit('添加新列表失败'); } $this->ajax_success_exit(); } /** * 事件: 修改"平台信息" * 地址:http://cas.lishuy.com/index.php?c=Admin_Platform_Index&a=ReqUp * 参数:见方法内 */ public function doReqUp() { $tableInfo = $_POST; $id = $tableInfo['id']; unset($tableInfo['id']); $operator_uid = $this->operatorData ['uid']; $info = array_merge($tableInfo, array( 'operator_uid' => $operator_uid )); $tmpResult = $this->objDPlatform->modify ( $info, array ( 'id' => $id ) ); if (!$tmpResult->isSuccess()) { $this->ajax_fail_exit($tmpResult->getData()); } $this->ajax_success_exit(); } /** * 事件: 删除"平台信息" * 地址:http://cas.lishuy.com/index.php?c=Admin_Platform_Index&a=ReqDel * 参数:见方法内 */ public function doReqDel() { $id = Request::p ( 'id' ); $this->objDPlatform->delete ( array ( 'id' => $id ) ); // TODO 根据前端自定义返回结果或跳转 header ( "Location: " . Request::schemeDomain () . "/?c=Admin_Platform_Index&a=PageList" ); exit (); } public function display() { return $this->render (); } }