objLottery = new Lottery (); $this->operatorData = $this->getUser (); } public function doDefault() { } /** * 页面:活动列表 * 地址:http://cas.lishuy.com/?c=Admin_Activity_ActivityList&a=PageList */ public function doPageList(){ $objDLotteryEvents = new LotteryEvents (); $eventsType = $objDLotteryEvents->getType (); $eventsDisplayStatus = $objDLotteryEvents->getDisplay (); // 取数据 $page = Request::varGetInt ( 'page', 1 ); $size = 24; $offset = ($page - 1) * $size; $limit = "{$offset},{$size}"; $condition = array(); $allLotteryEventsIds = $objDLotteryEvents->findIdsBy ( $condition, $limit, 'id desc' ); $eventsData = $objDLotteryEvents->gets ( $allLotteryEventsIds ); $total_num = $this->objLottery->getLotteryEventsListNum ( $condition ); $url_tpl = Request::schemeDomain () . "c=Admin_Activity_ActivityList&a=PageList"; $url_tpl .= "&page={page}"; // 分页 $objPage = new Page ( $total_num, $url_tpl, $page, $size ); $page_html = $objPage->html (); $this->setOutput ( 'page_html', $page_html ); $this->setOutput ( 'allEventsData', $eventsData ); $this->setOutput ( 'thisPageTitle', '所有发布' ); $this->tpl = 'admin/activity/activity_list'; $title = '活动列表'; $this->setOutput('title', $title); $this->setOutput('menu_active', array('name' => 'activitylist', 'item' => '')); //激活菜单 $this->addNavMenu('活动列表'); $this->setOutput('pagePublicData', $this->getPagePublicData()); // 后台管理相关数据 } /** * 页面:我的活动列表 * 地址:http://cas.lishuy.com/?c=Admin_Activity_ActivityList&a=PageMyList */ public function doPageMyList(){ $objDLotteryEvents = new LotteryEvents (); $eventsType = $objDLotteryEvents->getType (); $eventsDisplayStatus = $objDLotteryEvents->getDisplay (); // 取数据 $page = Request::varGetInt ( 'page', 1 ); $size = 24; $offset = ($page - 1) * $size; $limit = "{$offset},{$size}"; $condition = array( 'operator_uid' => $this->operatorData['uid'], 'del' => LotteryEvents::NOT_DEL ); if($this->isSuperadmin()){ $condition = array( 'del' => LotteryEvents::NOT_DEL ); } $allLotteryEventsIds = $objDLotteryEvents->findIdsBy ( $condition, $limit, 'id desc' ); $eventsData = $objDLotteryEvents->gets ( $allLotteryEventsIds ); $total_num = $this->objLottery->getLotteryEventsListNum ( $condition ); $url_tpl = Request::schemeDomain () . "?c=Admin_Activity_ActivityList&a=PageMyList"; $url_tpl .= "&page={page}"; // 分页 $objPage = new Page ( $total_num, $url_tpl, $page, $size ); $page_html = $objPage->html (); $allTypeData = $objDLotteryEvents ->getType(); $this->setOutput('allTypeData', $allTypeData); $this->setOutput ( 'page_html', $page_html ); $this->setOutput ( 'allEventsData', $eventsData ); $this->setOutput ( 'thisPageTitle', '我的发布' ); $this->tpl = 'admin/activity/activity_list'; $title = '我的发布'; $this->setOutput('title', $title); $this->setOutput('menu_active', array('name' => 'mypublish', 'item' => '')); //激活菜单 $this->addNavMenu('我的发布'); $this->setOutput('pagePublicData', $this->getPagePublicData()); // 后台管理相关数据 } /** * 删除操作 * 地址:http://cas.lishuy.com/?c=Admin_Activity_ActivityList&a=ReqDel */ public function doReqDel(){ $id = Request::p('id'); $objDLotteryEvents = new LotteryEvents (); $tableInfo = array( 'del' => LotteryEvents::IS_DEL, 'display' => LotteryEvents::LIST_DISPLAY_HIDE, ); $condition = array( 'id' => $id ); $objDLotteryEvents -> update($tableInfo, $condition); $this->ajax_success_exit($id); } /** * 回复删除操作 * 地址:http://cas.lishuy.com/?c=Admin_Activity_ActivityList&a=ReqReductionDel */ public function doReqReductionDel(){ $id = Request::p('id'); $objDLotteryEvents = new LotteryEvents (); $tableInfo = array( 'del' => LotteryEvents::NOT_DEL, 'display' => LotteryEvents::LIST_DISPLAY_HIDE, ); $condition = array( 'id' => $id ); $objDLotteryEvents -> update($tableInfo, $condition); $this->ajax_success_exit($id); } /** * 页面:我的已删除活动列表 * 地址:http://cas.lishuy.com/?c=Admin_Activity_ActivityList&a=PageDelMyList */ public function doPageDelMyList(){ $objDLotteryEvents = new LotteryEvents (); $eventsType = $objDLotteryEvents->getType (); $eventsDisplayStatus = $objDLotteryEvents->getDisplay (); // 取数据 $page = Request::varGetInt ( 'page', 1 ); $size = 24; $offset = ($page - 1) * $size; $limit = "{$offset},{$size}"; $condition = array( 'operator_uid' => $this->operatorData['uid'], 'del' => LotteryEvents::IS_DEL ); if($this->isSuperadmin()){ $condition = array( 'del' => LotteryEvents::IS_DEL ); } $allLotteryEventsIds = $objDLotteryEvents->findIdsBy ( $condition, $limit, 'id desc' ); $eventsData = $objDLotteryEvents->gets ( $allLotteryEventsIds ); $total_num = $this->objLottery->getLotteryEventsListNum ( $condition ); $url_tpl = Request::schemeDomain () . "?c=Admin_Activity_ActivityList&a=PageDelMyList"; $url_tpl .= "&page={page}"; // 分页 $objPage = new Page ( $total_num, $url_tpl, $page, $size ); $page_html = $objPage->html (); $allTypeData = $objDLotteryEvents ->getType(); $this->setOutput('allTypeData', $allTypeData); $this->setOutput ( 'page_html', $page_html ); $this->setOutput ( 'allEventsData', $eventsData ); $this->setOutput ( 'thisPageTitle', '删除的活动' ); $this->tpl = 'admin/activity/activity_del_list'; // 写到这了. $title = '删除的活动'; $this->setOutput('title', $title); $this->setOutput('menu_active', array('name' => 'mypublishdel', 'item' => '')); //激活菜单 $this->addNavMenu('我的发布'); $this->setOutput('pagePublicData', $this->getPagePublicData()); // 后台管理相关数据 } public function display() { return $this->render (); } }