| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 | 
							- <?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 KIF\Page\Page;
 
- use Cas\Module\User;
 
- use KIF\Data\Convert;
 
- use KIF\Verify;
 
- use Cas\Dao\LotteryUserFeedback;
 
- /**
 
-  * "活动相关" - "互动数据"
 
-  * 
 
-  * @author lihuanchun 
 
-  *          
 
-  */
 
- class FeedBack  extends Controller {
 
- 	private $objFeedBack;
 
- 	private $objLottery;
 
- 	private $peratorData;
 
- 	
 
- 	/**
 
- 	 *  初始化
 
- 	 */
 
- 	public function __construct() {
 
- 		header ( "Content-Type: text/html; charset=utf-8" );
 
- 		$this->objLottery = new Lottery ();
 
- 		$this->objFeedBack = new LotteryUserFeedback ();
 
- 		$this->operatorData = $this->getUser ();
 
- 	}
 
- 	
 
- 	public function doDefault() {
 
- 		
 
- 	}
 
- 	
 
- 	/**
 
- 	 * 获取当前互动的互动数据
 
- 	 * 地址:页面: http://cas.lishuy.com/?c=Admin_Activity_FeedBack&a=PageList&events_id=n
 
- 	 * 参数:events_id 活动ID 必填
 
- 	 * 参数:groupByUid 是否用户排重 
 
- 	 * 
 
- 	 */
 
- 	public function doPageList() {
 
- 		
 
- 		$events_id = Request::varGetInt ( 'events_id' );
 
- 		$eventData = $this->objLottery->getOneLotteryEvents ( $events_id );
 
- 		$this->setOutput ( 'eventData', $eventData );
 
- 		$page = Request::varGetInt ( 'page', 1 );
 
- 		$size = 10;
 
- 		$offset = ($page - 1) * $size;
 
- 		$limit = "{$offset},{$size}";
 
- 		$order = ' id desc';
 
- 		$condition = array (
 
- 				'events_id' => $events_id
 
- 		);
 
- 		$ids = $this->objFeedBack->findIdsBy ( $condition, $limit, $order );
 
- 		$fdData = $this->objFeedBack->gets ( $ids );
 
- 		$total_num = $this->objFeedBack->totals ( $condition );
 
- 		if ($fdData) {
 
- 			foreach ($fdData as $k => $v) {
 
- 				$fdData[$k]['pic'] = explode(',', $v['pic']);
 
- 			}
 
- 		}
 
- 		// 分页
 
- 		$url_tpl = Request::url();
 
- 		$url_tpl .= "&page={page}";
 
- 		$objPage = new Page ( $total_num, $url_tpl, $page, $size );
 
- 		$page_html = $objPage->html ();
 
- 		
 
- 		$uids = array ();
 
- 		foreach ( $logData as $key => $data ) {
 
- 			$uids [$data ['uid']] = $data ['uid'];
 
- 		}
 
- 		
 
- 		# 通过UIDs 获取用户信息
 
- 		$objMUser = new User();
 
- 		$userData = $objMUser -> gets($uids);
 
- 		
 
- 		$this->tpl = 'admin/activity/user_feedback';
 
- 		$title = '用户反馈';
 
- 		$this->setOutput('title', $title);
 
- 		$this->setOutput('menu_active', array('name' => 'mypublish', 'item' => '')); //激活菜单
 
- 		$this->addNavMenu('活动列表');
 
- 		$this->addNavMenu($title);
 
- 		
 
- 		// 获取所有活动类型
 
- 		$typeData = LotteryEvents::getType ();
 
- 		
 
- 		// 转换格式
 
- 		if($eventData['type'] == LotteryEvents:: TYPE_EVENTS_SURVEY && $_GET['action'] == 'all'){
 
- 			$logData =$this->setData($eventData,$logData);
 
- 		}
 
- 		
 
- 		$navConfig = $this->getUpPageNav($events_id, 'FeedBack');
 
- 		$eventsDisplayStatus = LotteryEvents::getDisplay (); // [活动] 是否显示
 
- 		
 
- 		$this->setOutput ( 'eventsDisplayStatus', $eventsDisplayStatus );
 
- 		$this->setOutput ( 'navConfig', $navConfig ); //公用内部导航信息
 
- 		$this->setOutput ( 'page_html', $page_html ); //分页HTML
 
- 		$this->setOutput ( 'total_num', $total_num ); //分页HTML
 
- 		$this->setOutput ( 'fdData', $fdData ); // feedback
 
- 		$this->setOutput ( 'userData', $userData ); // 当前列表用户信息
 
- 		$this->setOutput ( 'eventData', $eventData ); // 当前活动信息
 
- 		$this->setOutput ( 'typeData', $typeData );
 
- 		$this->setOutput('displayDesc', LotteryEvents::getDisplay());
 
- 		$this->setOutput('pagePublicData', $this->getPagePublicData($events_id)); // 后台管理相关数据
 
- 		
 
- 	}
 
- 	
 
- 	/**
 
- 	 * 事件:更新隐藏状态
 
- 	 * 地址:http://cas.lishuy.com/index.php?c=Admin_Activity_FeedBack&a=Audit
 
- 	 * 参数:见方法内
 
- 	 */
 
- 	public function doStatus() {
 
- 		$tableInfo = $_POST;
 
- 		if (isset($tableInfo['yes']) && $tableInfo['yes']) {
 
- 			$tableInfo['yes'] = explode(',', $tableInfo['yes']);
 
- 			foreach ($tableInfo['yes'] as $k => $v) {
 
- 				$info = array(
 
- 					'status' => 1,
 
- 					'operator_uid' => $operator_uid
 
- 				);
 
- 				$this->objFeedBack->modify( $info, array (
 
- 						'id' => $v 
 
- 				));
 
- 			}
 
- 		}
 
- 		if (isset($tableInfo['no']) && $tableInfo['no']) {
 
- 			$tableInfo['no'] = explode(',', $tableInfo['no']);
 
- 			foreach ($tableInfo['no'] as $k => $v) {
 
- 				$info = array(
 
- 					'status' => 2,
 
- 					'operator_uid' => $operator_uid
 
- 				);
 
- 				$this->objFeedBack->modify( $info, array (
 
- 						'id' => $v 
 
- 				));
 
- 			}
 
- 		}
 
- 		
 
- 		$this->ajax_success_exit();
 
- 	}
 
- 	
 
- 	public function display() {
 
- 		return $this->render ();
 
- 	}
 
- }
 
- 	
 
 
  |