Coupon.php 753 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. *
  4. * @copyright ©2020 点小铺
  5. * @author hanj
  6. * @link: https://dyuit.com
  7. * Created by VSCode
  8. */
  9. namespace app\api\controller;
  10. use app\api\model\Coupon as CouponModel;
  11. /**
  12. * 优惠券中心
  13. * Class Coupon
  14. * @package app\api\controller
  15. */
  16. class Coupon extends Controller
  17. {
  18. /**
  19. * 优惠券列表
  20. * @return array
  21. * @throws \app\common\exception\BaseException
  22. * @throws \think\db\exception\DataNotFoundException
  23. * @throws \think\db\exception\ModelNotFoundException
  24. * @throws \think\exception\DbException
  25. */
  26. public function lists()
  27. {
  28. $model = new CouponModel;
  29. $list = $model->getList($this->getUser(false));
  30. return $this->renderSuccess(compact('list'));
  31. }
  32. }