| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 | 
							- <?php
 
- namespace Cas\Controller\Admin\Activity;
 
- use Cas\Module\Lottery;
 
- use Cas\Dao\PlatformBulletin;
 
- use KIF\Core\Request;
 
- use Cas\Dao\LotteryEvents;
 
- use Cas\Controller\Admin\Controller;
 
- use Cas\Dao\Platform;
 
- use Cas\Dao\LotteryDeliveryChannels;
 
- use KIF\Core\Config;
 
- use Cas\Dao\LotteryPvUvLog;
 
- use KIF\Dao\SqlHelper;
 
- use KIF\Dao\AbstractDao;
 
- use KIF\Page\Page;
 
- /**
 
-  * "活动相关" - "活动列表"
 
-  * 
 
-  * @author lihuanchun 
 
-  *          
 
-  */
 
- class ActivityList  extends Controller {
 
- 	private $objLottery; // 活动后端
 
- 	private $peratorData;
 
- 	
 
- 	/**
 
- 	 *  初始化
 
- 	 */
 
- 	public function __construct() {
 
- 		header ( "Content-Type: text/html; charset=utf-8" );
 
- 		$this->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 ();
 
- 	}
 
- }
 
- 	
 
 
  |