123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- /**
- * PtbController.php UTF-8
- * 平台币
- *
- * @date : 2018/6/2 15:46
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : luowei <lw@huosdk.com>
- * @version : HUOSDK 8.0
- */
- namespace api\wapapp\controller\v8;
- use api\common\controller\V2ApiBaseController;
- use huo\controller\wallet\Ptb;
- use huolib\constant\OrderConst;
- use huolib\constant\WalletConst;
- class PtbController extends V2ApiBaseController {
- public function _initialize() {
- parent::_initialize();
- $this->checkLogin();
- }
- /**
- * 平台消费记录列表
- * http://doc.1tsdk.com/138?page_id=3142
- * 【域名】/v8/ptb/consume/record_list
- */
- public function consumeRecord() {
- $_mem_id = $this->mem_id;
- $_page = get_val($this->rq_data, 'page', 0); /* 页码 默认为1 代表第一页 1 */
- $_offset = get_val($this->rq_data, 'offset', 10); /* 每页显示数量 默认为10 */
- $_map = [];
- $_page = $_page.','.$_offset;
- $_rdata = (new Ptb())->getMemConsumeList($_mem_id, $_map, $_page);
- return $this->returnData($_rdata);
- }
- /**
- * 平台充值记录列表
- * http://doc.1tsdk.com/138?page_id=3140
- * 【域名】/v8/ptb/recharge/record_list
- */
- public function rechargeRecord() {
- $_mem_id = $this->mem_id;
- $_page = get_val($this->rq_data, 'page', 0); /* 页码 默认为1 代表第一页 1 */
- $_offset = get_val($this->rq_data, 'offset', 10); /* 每页显示数量 默认为10 */
- $_status = get_val($this->rq_data, 'status', 0);
- $_map = [];
- $_order_status = array_keys(OrderConst::getPayStatusMsg(0,true));
- if (in_array($_status, $_order_status)) {
- $_map['status'] = $_status;
- }
- $_page = $_page.','.$_offset;
- $_where['type'] = WalletConst::WALLET_TYPE_CHARGE;
- $_rdata = (new Ptb())->getMemChargeList($_mem_id, $_map, $_page);
- return $this->returnData($_rdata);
- }
- }
|