Index.class.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. namespace Cas\Controller\Admin;
  3. use Cas\Module\Lottery;
  4. use Cas\Dao\PlatformBulletin;
  5. use KIF\Core\Request;
  6. use Cas\Dao\LotteryEvents;
  7. /**
  8. * "活动相关" - "默认首页" &"后台大首页"
  9. * 页面: 后台管理首页 doDefault
  10. * @author lihuanchun 
  11. *  
  12. */
  13. class Index extends Controller {
  14. private $objLottery; // 活动后端
  15. private $operatorData;
  16. /**
  17. *  初始化
  18. */
  19. public function __construct() {
  20. header ( "Content-Type: text/html; charset=utf-8" );
  21. $this->objLottery = new Lottery ();
  22. $this->operatorData = $this->getUser();
  23. $this->setOutput('title', $title);
  24. }
  25. /**
  26. * 默认页面
  27. * 1.获取当前操作员用户信息
  28. * 2.获取平台公告10条信息
  29. * 3.活动发布快捷通道
  30. * 4.所有活动
  31. * 地址:http://cas.lishuy.com/?c=Admin_Index
  32. */
  33. public function doDefault(){
  34. # 获取平台公告10条信息
  35. $bulletinData = array();
  36. $objPlatformBulletin = new PlatformBulletin();
  37. $condition = array();
  38. $limit = 6;
  39. $order = 'create_time desc';
  40. $bulletinIds = $objPlatformBulletin -> findIdsBy($condition,$limit,$order);
  41. $bulletinData = $objPlatformBulletin -> gets($bulletinIds);
  42. # 活动发布快捷通道 ,这里为了方便直接硬编码了
  43. $url = Request::schemeDomain().'/?c=Admin_Activity_SetBasics&a=PageCreate&type=';
  44. # 获取所有活动
  45. $allActivityData = array();
  46. $objDLotteryEvents = new LotteryEvents();
  47. $limit = null;
  48. $order = 'id desc';
  49. $condition = array(
  50. 'operator_uid' => $this->operatorData['uid']
  51. );
  52. $ids = $objDLotteryEvents->findIdsBy($condition,null,'id desc');
  53. $allActivityData = $objDLotteryEvents -> gets($ids);
  54. $this->tpl = 'admin/index';
  55. $title = '活动首页';
  56. $this->setOutput('title', $title);
  57. $this->setOutput('menu_active', array('name' => 'platfromhome', 'item' => '')); //激活菜单
  58. $this->addNavMenu($title, Request::url());
  59. $allTypeData = $objDLotteryEvents ->getType();
  60. $this->setOutput('allTypeData', $allTypeData);
  61. $this->setOutput('bulletinData', $bulletinData); // 获取平台公告10条信息
  62. $this->setOutput('operatorData', $this->operatorData); // 当前操作者信息
  63. $this->setOutput('myReleaseActivityData', $allActivityData); // 获取所有活动
  64. $this->setOutput('pagePublicData', $this->getPagePublicData()); // 后台管理相关数据
  65. }
  66. /**
  67. * 显示方法
  68. *
  69. */
  70. public function display() {
  71. return $this->render();
  72. }
  73. /**
  74. * 临时创建二维码图片
  75. * http://cas.lishuy.com/?c=Admin_Index&a=TMPCreateImg
  76. */
  77. public function doTMPCreateImg(){
  78. $url = Request::p('url');
  79. $this -> createImgCodeUrl($url);
  80. $this->ajax_success_exit('ok');
  81. }
  82. }