ServerController.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * ServerController.php UTF-8
  4. * 开服处理类
  5. *
  6. * @date : 2018/1/19 16:26
  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\GameserverLogic;
  15. class ServerController extends WebBaseController {
  16. public function __construct() {
  17. parent::__construct();
  18. }
  19. public function index() {
  20. $_web_info = $this->web_info;
  21. $this->set_seo($_web_info['web_basic']['company_name']);
  22. $_server_class = new GameserverLogic();
  23. $_row = $this->request->param('row', 20);
  24. $_today_page = $this->request->param('today_page', 1);
  25. $_tomorrow_page = $this->request->param('tomorrow_page', 1);
  26. $_time1 = strtotime(date('Y-m-d'));
  27. $_time2 = strtotime(date('Y-m-d').' 23:59:59');
  28. $_time3 = strtotime(date('Y-m-d', strtotime('+1 day')).' 23:59:59');
  29. $_today_map = [
  30. 'time' => ['BETWEEN', [$_time1, $_time2]]
  31. ];
  32. $_tomorrow_map = [
  33. 'time' => ['BETWEEN', [$_time2, $_time3]]
  34. ];
  35. $_rdata['today'] = $_server_class->getList($_today_map, $_today_page.','.$_row);
  36. $_rdata['tomorrow'] = $_server_class->getList($_tomorrow_map, $_tomorrow_page.','.$_row);
  37. $_rdata['today_date'] = date('m-d');
  38. $_rdata['tomorrow_date'] = date('m-d', strtotime('+1 day'));
  39. $this->assign($_rdata);
  40. return $this->fetch('Server/index');
  41. }
  42. }