HomeController.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * HomeController.php UTF-8
  4. *
  5. *
  6. * @date : 2018/6/14 14:25
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : luowei <lw@huosdk.com>
  10. * @version : HUOSDK 8.0
  11. */
  12. namespace api\wapapp\controller\v8;
  13. use api\common\controller\V2ApiBaseController;
  14. use huo\controller\game\GameList;
  15. use huo\controller\slide\Slide;
  16. use huo\logic\slide\SlideLogic;
  17. use huolib\constant\GameConst;
  18. use huolib\constant\SlideConst;
  19. class HomeController extends V2ApiBaseController {
  20. public function _initialize() {
  21. parent::_initialize();
  22. }
  23. /**
  24. * 首页请求
  25. * http://doc.1tsdk.com/138?page_id=2838
  26. * 【域名】/v8/home/index
  27. */
  28. public function index() {
  29. //顶部轮播图
  30. $_app_index = (new SlideLogic())->getList(['type' => SlideConst::SLIDE_APP_INDEX]);
  31. //轮播文字
  32. $_app_index_text = (new SlideLogic())->getList(['type' => SlideConst::SLIDE_APP_INDEX_TEXT]);
  33. //新游推荐轮播图
  34. $_app_index_rmd = (new SlideLogic())->getList(['type' => SlideConst::SLIDE_APP_INDEX_RMD]);;
  35. //推荐游戏列表
  36. $_new_rmd = (new GameList())->getList(['remd' => GameConst::GAME_IS_NEW], '1,5');
  37. //猜你喜欢游戏列表
  38. $_like_game = (new GameList())->getList(['is_new' => GameConst::GAME_IS_NEW], '1,5');
  39. $_return_data = [
  40. 'hometopper' => $_app_index,
  41. 'texthome' => $_app_index_text,
  42. 'homenewrmd' => $_app_index_rmd,
  43. 'newrmd' => $_new_rmd['data'],
  44. 'likegame' => $_like_game['data'],
  45. ];
  46. $this->success(lang('SUCCESS'), $_return_data);
  47. }
  48. }