PtbController.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * PtbController.php UTF-8
  4. * 平台币
  5. *
  6. * @date : 2018/6/2 15:46
  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\wallet\Ptb;
  15. use huolib\constant\OrderConst;
  16. use huolib\constant\WalletConst;
  17. class PtbController extends V2ApiBaseController {
  18. public function _initialize() {
  19. parent::_initialize();
  20. $this->checkLogin();
  21. }
  22. /**
  23. * 平台消费记录列表
  24. * http://doc.1tsdk.com/138?page_id=3142
  25. * 【域名】/v8/ptb/consume/record_list
  26. */
  27. public function consumeRecord() {
  28. $_mem_id = $this->mem_id;
  29. $_page = get_val($this->rq_data, 'page', 0); /* 页码 默认为1 代表第一页 1 */
  30. $_offset = get_val($this->rq_data, 'offset', 10); /* 每页显示数量 默认为10 */
  31. $_map = [];
  32. $_page = $_page.','.$_offset;
  33. $_rdata = (new Ptb())->getMemConsumeList($_mem_id, $_map, $_page);
  34. return $this->returnData($_rdata);
  35. }
  36. /**
  37. * 平台充值记录列表
  38. * http://doc.1tsdk.com/138?page_id=3140
  39. * 【域名】/v8/ptb/recharge/record_list
  40. */
  41. public function rechargeRecord() {
  42. $_mem_id = $this->mem_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 Ptb())->getMemChargeList($_mem_id, $_map, $_page);
  54. return $this->returnData($_rdata);
  55. }
  56. }