OrderController.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * OrderController.php UTF-8
  4. *
  5. *
  6. * @date : 2018/6/6 14:59
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : luowei <lw@huosdk.com>
  10. * @version : HUOSDK 8.0
  11. */
  12. namespace h5wap\wap\controller;
  13. use h5wap\common\controller\V2BaseController;
  14. use huo\controller\member\Member;
  15. use huo\controller\pay\Order;
  16. use huolib\constant\OrderConst;
  17. use think\Cache;
  18. use think\Session;
  19. class OrderController extends V2BaseController {
  20. public function _initialize() {
  21. parent::_initialize();
  22. $this->checkLogin();
  23. }
  24. /**
  25. * 充值记录
  26. * http://doc.1tsdk.com/138?page_id=3445
  27. * 【域名】/cfloat/order/list
  28. */
  29. public function index() {
  30. $_user_info = (new Member())->getMemInfo($this->mem_id);
  31. $this->assign('user_info', $_user_info);
  32. return $this->fetch('order/index');
  33. }
  34. public function getOrderList() {
  35. $_page = get_val($this->rq_data, 'page', 0); /* 页码 默认为1 代表第一页 1 */
  36. $_offset = get_val($this->rq_data, 'offset', 10); /* 每页显示数量 默认为10 */
  37. $_status = get_val($this->rq_data, 'status', 2); /*显示成功的*/
  38. $_map = [];
  39. $_order_status = array_keys(OrderConst::getPayStatusMsg(0, true));
  40. if (in_array($_status, $_order_status)) {
  41. $_map['status'] = $_status;
  42. }
  43. $_page = $_page.','.$_offset;
  44. $_data = (new Order())->getMemOrderList($this->mem_id, $_map, $_page);
  45. $this->returnData($_data);
  46. }
  47. }