FeedBack.class.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?php
  2. namespace Cas\Controller\Admin\Activity;
  3. use Cas\Module\Lottery;
  4. use Cas\Dao\PlatformBulletin;
  5. use KIF\Core\Request;
  6. use Cas\Dao\LotteryEvents;
  7. use Cas\Controller\Admin\Controller;
  8. use Cas\Dao\Platform;
  9. use Cas\Dao\LotteryDeliveryChannels;
  10. use KIF\Core\Config;
  11. use KIF\Page\Page;
  12. use Cas\Module\User;
  13. use KIF\Data\Convert;
  14. use KIF\Verify;
  15. use Cas\Dao\LotteryUserFeedback;
  16. /**
  17. * "活动相关" - "互动数据"
  18. *
  19. * @author lihuanchun 
  20. *  
  21. */
  22. class FeedBack extends Controller {
  23. private $objFeedBack;
  24. private $objLottery;
  25. private $peratorData;
  26. /**
  27. *  初始化
  28. */
  29. public function __construct() {
  30. header ( "Content-Type: text/html; charset=utf-8" );
  31. $this->objLottery = new Lottery ();
  32. $this->objFeedBack = new LotteryUserFeedback ();
  33. $this->operatorData = $this->getUser ();
  34. }
  35. public function doDefault() {
  36. }
  37. /**
  38. * 获取当前互动的互动数据
  39. * 地址:页面: http://cas.lishuy.com/?c=Admin_Activity_FeedBack&a=PageList&events_id=n
  40. * 参数:events_id 活动ID 必填
  41. * 参数:groupByUid 是否用户排重 
  42. *
  43. */
  44. public function doPageList() {
  45. $events_id = Request::varGetInt ( 'events_id' );
  46. $eventData = $this->objLottery->getOneLotteryEvents ( $events_id );
  47. $this->setOutput ( 'eventData', $eventData );
  48. $page = Request::varGetInt ( 'page', 1 );
  49. $size = 10;
  50. $offset = ($page - 1) * $size;
  51. $limit = "{$offset},{$size}";
  52. $order = ' id desc';
  53. $condition = array (
  54. 'events_id' => $events_id
  55. );
  56. $ids = $this->objFeedBack->findIdsBy ( $condition, $limit, $order );
  57. $fdData = $this->objFeedBack->gets ( $ids );
  58. $total_num = $this->objFeedBack->totals ( $condition );
  59. if ($fdData) {
  60. foreach ($fdData as $k => $v) {
  61. $fdData[$k]['pic'] = explode(',', $v['pic']);
  62. }
  63. }
  64. // 分页
  65. $url_tpl = Request::url();
  66. $url_tpl .= "&page={page}";
  67. $objPage = new Page ( $total_num, $url_tpl, $page, $size );
  68. $page_html = $objPage->html ();
  69. $uids = array ();
  70. foreach ( $logData as $key => $data ) {
  71. $uids [$data ['uid']] = $data ['uid'];
  72. }
  73. # 通过UIDs 获取用户信息
  74. $objMUser = new User();
  75. $userData = $objMUser -> gets($uids);
  76. $this->tpl = 'admin/activity/user_feedback';
  77. $title = '用户反馈';
  78. $this->setOutput('title', $title);
  79. $this->setOutput('menu_active', array('name' => 'mypublish', 'item' => '')); //激活菜单
  80. $this->addNavMenu('活动列表');
  81. $this->addNavMenu($title);
  82. // 获取所有活动类型
  83. $typeData = LotteryEvents::getType ();
  84. // 转换格式
  85. if($eventData['type'] == LotteryEvents:: TYPE_EVENTS_SURVEY && $_GET['action'] == 'all'){
  86. $logData =$this->setData($eventData,$logData);
  87. }
  88. $navConfig = $this->getUpPageNav($events_id, 'FeedBack');
  89. $eventsDisplayStatus = LotteryEvents::getDisplay (); // [活动] 是否显示
  90. $this->setOutput ( 'eventsDisplayStatus', $eventsDisplayStatus );
  91. $this->setOutput ( 'navConfig', $navConfig ); //公用内部导航信息
  92. $this->setOutput ( 'page_html', $page_html ); //分页HTML
  93. $this->setOutput ( 'total_num', $total_num ); //分页HTML
  94. $this->setOutput ( 'fdData', $fdData ); // feedback
  95. $this->setOutput ( 'userData', $userData ); // 当前列表用户信息
  96. $this->setOutput ( 'eventData', $eventData ); // 当前活动信息
  97. $this->setOutput ( 'typeData', $typeData );
  98. $this->setOutput('displayDesc', LotteryEvents::getDisplay());
  99. $this->setOutput('pagePublicData', $this->getPagePublicData($events_id)); // 后台管理相关数据
  100. }
  101. /**
  102. * 事件:更新隐藏状态
  103. * 地址:http://cas.lishuy.com/index.php?c=Admin_Activity_FeedBack&a=Audit
  104. * 参数:见方法内
  105. */
  106. public function doStatus() {
  107. $tableInfo = $_POST;
  108. if (isset($tableInfo['yes']) && $tableInfo['yes']) {
  109. $tableInfo['yes'] = explode(',', $tableInfo['yes']);
  110. foreach ($tableInfo['yes'] as $k => $v) {
  111. $info = array(
  112. 'status' => 1,
  113. 'operator_uid' => $operator_uid
  114. );
  115. $this->objFeedBack->modify( $info, array (
  116. 'id' => $v
  117. ));
  118. }
  119. }
  120. if (isset($tableInfo['no']) && $tableInfo['no']) {
  121. $tableInfo['no'] = explode(',', $tableInfo['no']);
  122. foreach ($tableInfo['no'] as $k => $v) {
  123. $info = array(
  124. 'status' => 2,
  125. 'operator_uid' => $operator_uid
  126. );
  127. $this->objFeedBack->modify( $info, array (
  128. 'id' => $v
  129. ));
  130. }
  131. }
  132. $this->ajax_success_exit();
  133. }
  134. public function display() {
  135. return $this->render ();
  136. }
  137. }