Coupon.php 644 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\api\controller;
  3. use app\api\model\Coupon as CouponModel;
  4. /**
  5. * 优惠券中心
  6. * Class Coupon
  7. * @package app\api\controller
  8. */
  9. class Coupon extends Controller
  10. {
  11. /**
  12. * 优惠券列表
  13. * @return array
  14. * @throws \app\common\exception\BaseException
  15. * @throws \think\db\exception\DataNotFoundException
  16. * @throws \think\db\exception\ModelNotFoundException
  17. * @throws \think\exception\DbException
  18. */
  19. public function lists()
  20. {
  21. $model = new CouponModel;
  22. $list = $model->getList($this->getUser(false));
  23. return $this->renderSuccess(compact('list'));
  24. }
  25. }