ShareController.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * ShareController.php UTF-8
  4. * 游戏分享落地页
  5. *
  6. * @date : 2018/9/14 11:07
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : chenbingling <cbl@huosdk.com>
  10. * @version : HuoMP 1.0
  11. */
  12. namespace box\api\controller;
  13. use box\common\controller\V2ApiBaseController;
  14. use huolib\status\CommonStatus;
  15. use huomp\controller\share\ShareOut;
  16. class ShareController extends V2ApiBaseController {
  17. /**
  18. * 游戏分享落地页914
  19. * http://doc.1tsdk.com/159?page_id=4645
  20. * 【域名】/share/game/detail
  21. */
  22. public function index() {
  23. $this->checkLogin();
  24. $_game_id = get_val($this->rq_data, 'game_id');
  25. $_state = get_val($this->rq_data, 'state');
  26. if (empty($_game_id) || empty($_state)) {
  27. $_code = CommonStatus::INVALID_PARAMS;
  28. $_rdata = [
  29. 'code' => $_code,
  30. 'msg' => CommonStatus::getMsg($_code),
  31. 'data' => []
  32. ];
  33. $this->returnData($_rdata);
  34. }
  35. $_rdata = (new ShareOut())->getSharePage($_state, $_game_id);
  36. $this->returnData($_rdata);
  37. }
  38. }