Membermallvoucher.php 1.6 KB

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