Coupon.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2024 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types=1);
  12. namespace app\api\controller;
  13. use think\response\Json;
  14. use app\api\model\Coupon as CouponModel;
  15. use cores\exception\BaseException;
  16. /**
  17. * 优惠券中心
  18. * Class Coupon
  19. * @package app\api\controller
  20. */
  21. class Coupon extends Controller
  22. {
  23. /**
  24. * 优惠券列表
  25. * @return Json
  26. * @throws BaseException
  27. * @throws \think\db\exception\DataNotFoundException
  28. * @throws \think\db\exception\DbException
  29. * @throws \think\db\exception\ModelNotFoundException
  30. */
  31. public function list(): Json
  32. {
  33. $model = new CouponModel;
  34. $list = $model->getList();
  35. return $this->renderSuccess(compact('list'));
  36. }
  37. }