Membermallvoucher.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\api\controller;
  3. use think\facade\Lang;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  9. * 网站地址: https://www.valimart.net/
  10. * ----------------------------------------------------------------------------
  11. *
  12. * ============================================================================
  13. * 代金券控制器
  14. */
  15. class Membermallvoucher extends MobileMember
  16. {
  17. public function initialize()
  18. {
  19. parent::initialize(); // TODO: Change the autogenerated stub
  20. Lang::load(base_path() . 'home/lang/'.config('lang.default_lang').'/voucher.lang.php');
  21. }
  22. /**
  23. * @api {POST} api/Membermallvoucher/mallvoucher_list 平台代金卷列表
  24. * @apiVersion 1.0.0
  25. * @apiGroup MemberVoucher
  26. *
  27. * @apiHeader {String} X-DS-KEY 用户授权token
  28. *
  29. * @apiSuccess {String} code 返回码,10000为成功
  30. * @apiSuccess {String} message 返回消息
  31. * @apiSuccess {Object} result 返回数据
  32. * @apiSuccess {Object[]} result.voucher_list 代金卷列表 (返回字段参考voucher表、store表、vouchertemplate表)
  33. * @apiSuccess {Int} result.page_total 总页数
  34. * @apiSuccess {Boolean} result.hasmore 是否有更多 true是false否
  35. */
  36. public function mallvoucher_list()
  37. {
  38. $mallvoucher_model = model('mallvouchertemplate');
  39. $mallvoucher_state = !empty(input('post.mallvoucher_state')) ? input('post.mallvoucher_state') : '';
  40. $mallvoucher_list = $mallvoucher_model->getMemberMallvoucherList(session('member_id'), $mallvoucher_state, $this->pagesize);
  41. $result = array_merge(array('mallvoucher_list' => $mallvoucher_list), mobile_page($mallvoucher_model->page_info));
  42. ds_json_encode(10000, '', $result);
  43. }
  44. }