1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- /**
- * GameController.php UTF-8
- * 小程序游戏信息查询接口
- *
- * @date : 2019/8/19 11:52
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : dengcongshuai <dcs@huosdk.com>
- * @version : HuoMp 1.0
- */
- namespace mini\sdk\controller;
- use huo\controller\game\GameCache;
- use huolib\status\CommonStatus;
- use mini\common\controller\V2ApiBaseController;
- class GameController extends V2ApiBaseController {
- public function _initialize() {
- parent::_initialize();
- }
- /**
- * 小程序卡片信息
- * http://doc.1tsdk.com/159?page_id=8627
- * 【域名】/mp/game/minicard
- */
- public function miniCard() {
- $_app_id = get_val($this->rq_data, 'app_id', 0);
- $_game_ext_info = (new GameCache())->getInfoByAppId($_app_id);
- $_rdata = [
- 'title' => '',
- 'url' => '',
- 'picture' => '',
- ];
- if (!empty($_game_ext_info['ext_info'])) {
- $_ext = $_game_ext_info['ext_info'];
- $_rdata['title'] = !empty($_ext['mini_card_title']) ? $_ext['mini_card_title'] : '';
- $_rdata['url'] = !empty($_ext['mini_card_url']) ? $_ext['mini_card_url'] : '';
- $_rdata['picture'] = !empty($_ext['mini_card_pay_picture']) ? cmf_get_image_url(
- $_ext['mini_card_pay_picture']
- )
- : '';
- }
- $this->success(lang('SUCCESS'), $_rdata);
- }
- /**
- * 游戏停留时间上报
- * http://doc.1tsdk.com/159?page_id=9625
- * 【域名】/mp/game/heartbeat
- */
- public function heartbeat() {
- $_code = CommonStatus::NO_ERROR;
- $this->success(CommonStatus::getMsg($_code), [], $_code);
- /* END 2020/6/19 ISSUES:12563 */
- }
- }
|