UserCouponController.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\UserApi;
  4. /**
  5. * 用户端优惠券模块
  6. */
  7. class UserCouponController extends UserApi
  8. {
  9. protected $noNeedLogin = [];
  10. protected $noNeedRight = '*';
  11. /**
  12. * 优惠券列表
  13. * @ApiReturnParams (name=id,description=优惠券id)
  14. * @ApiReturnParams (name=type,description=优惠券类型,1代金券2满减券3折扣券4新用户下单券)
  15. * @ApiReturnParams (name=max,description=优惠券满多少才可用,满减券才有这个参数)
  16. * @ApiReturnParams (name=amount,description=金额,对于折扣券则是几折)
  17. * @ApiReturnParams (name=start_time,description=开始时间)
  18. * @ApiReturnParams (name=end_time,description=过期时间)
  19. * @ApiReturnParams (name=is_used,description=是否已使用)
  20. */
  21. public function list(){
  22. $list=$this->auth
  23. ->getUser()
  24. ->coupon()
  25. ->order('id','desc')
  26. ->use()
  27. ->select();
  28. $this->success('',$list);
  29. }
  30. }