IndexController.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /**
  3. * IndexController.php UTF-8
  4. * 首页控制器
  5. *
  6. * @date : 2018/1/19 11:36
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : linjiebin <ljb@huosdk.com>
  10. * @version : HUOSDK 8.0
  11. */
  12. namespace web\pc\controller\v8;
  13. use web\common\controller\WebBaseController;
  14. use web\pc\logic\GameLogic;
  15. use web\pc\logic\GiftLogic;
  16. use web\pc\logic\PostLogic;
  17. use web\pc\logic\SlideLogic;
  18. use web\pc\logic\LinksLogic;
  19. use web\pc\logic\GameserverLogic;
  20. class IndexController extends WebBaseController {
  21. public function __construct() {
  22. parent::__construct();
  23. }
  24. /**
  25. * 首页
  26. *
  27. * @return mixed
  28. */
  29. public function index() {
  30. $_web_info = $this->web_info;
  31. $this->set_seo($_web_info['web_basic']['company_name']);
  32. $_game_class = new GameLogic();
  33. $_gift_class = new GiftLogic();
  34. $_posts_class = new PostLogic();
  35. $_slide_class = new SlideLogic();
  36. $_links_class = new LinksLogic();
  37. $_server_class = new GameserverLogic();
  38. $_fine_game = $_game_class->getList(['fine' => 1], '1,10', '-fine_order');
  39. $_hot_game = $_game_class->getList(['hot' => 1], '1,4', '-hot_order');
  40. $_gift_list = $_gift_class->getGifts(0);
  41. $_news_list['new'] = $_posts_class->getList(['catalog' => 1], '1,5','id desc');
  42. $_news_list['activity'] = $_posts_class->getList(['catalog' => 2], '1,5');
  43. $_news_list['strategy'] = $_posts_class->getList(['catalog' => 3], '1,5');
  44. $_bg_thumb = $_slide_class->getList(['type' => 'web_index_middle']);
  45. $_text = $_slide_class->getList(['type' => 'web_index_text']);
  46. $_link = $_links_class->getList();
  47. $_time1 = strtotime(date('Y-m-d'));
  48. $_time2 = strtotime(date('Y-m-d').' 23:59:59');
  49. $_today_map = [
  50. 'time' => ['BETWEEN', [$_time1, $_time2]]
  51. ];
  52. $_server_list = $_server_class->getList($_today_map, '1,5');
  53. $_rdata = [
  54. 'fine_game' => $_fine_game,
  55. 'gift_list' => $_gift_list,
  56. 'news' => $_news_list,
  57. 'hot_game' => $_hot_game,
  58. 'bg_thumb' => $_bg_thumb,
  59. 'link' => $_link,
  60. 'server_list' => $_server_list,
  61. 'text' => $_text
  62. ];
  63. $this->assign($_rdata);
  64. return $this->fetch('Index/index');
  65. }
  66. }