GmController.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * GmController.php UTF-8
  4. *
  5. * @date : 2018/6/5 16:44
  6. *
  7. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  8. * @author : luowei <lw@huosdk.com>
  9. * @version : HUOSDK 8.0
  10. */
  11. namespace api\wapapp\controller\v8;
  12. use api\common\controller\V2ApiBaseController;
  13. use huo\controller\wallet\Gamemoney;
  14. use huolib\constant\OrderConst;
  15. use huolib\constant\WalletConst;
  16. class GmController extends V2ApiBaseController {
  17. public function _initialize() {
  18. parent::_initialize();
  19. $this->checkLogin();
  20. }
  21. /**
  22. * 游戏币消费记录
  23. * http://doc.1tsdk.com/138?page_id=3439
  24. * 【域名】/v8/gamemoney/consume_list
  25. */
  26. public function consumeRecord() {
  27. $_mem_id = $this->getMemId();
  28. $_page = get_val($this->rq_data, 'page', 0); /* 页码 默认为1 代表第一页 1 */
  29. $_offset = get_val($this->rq_data, 'offset', 10); /* 每页显示数量 默认为10 */
  30. $_map = [];
  31. $_page = $_page.','.$_offset;
  32. $_rdata = (new Gamemoney())->getMemConsumeList($_mem_id, $_map, $_page);
  33. return $this->returnData($_rdata);
  34. }
  35. /**
  36. * 游戏充值记录列表
  37. * http://doc.1tsdk.com/138?page_id=3440
  38. * 【域名】/v8/gamemoney/recharge/record_list
  39. */
  40. public function rechargeRecord() {
  41. $_mem_id = $this->mem_id;
  42. $_app_id = get_val($this->rq_data, 'app_id');
  43. $_page = get_val($this->rq_data, 'page', 0); /* 页码 默认为1 代表第一页 1 */
  44. $_offset = get_val($this->rq_data, 'offset', 10); /* 每页显示数量 默认为10 */
  45. $_status = get_val($this->rq_data, 'status', 0);
  46. $_map = [];
  47. $_order_status = array_keys(OrderConst::getPayStatusMsg(0,true));
  48. if (in_array($_status, $_order_status)) {
  49. $_map['status'] = $_status;
  50. }
  51. $_page = $_page.','.$_offset;
  52. $_where['type'] = WalletConst::WALLET_TYPE_CHARGE;
  53. $_rdata = (new Gamemoney())->getMemChargeList($_mem_id, $_app_id, $_map, $_page);
  54. return $this->returnData($_rdata);
  55. }
  56. }