You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.7 KiB

5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://doc.hyperf.io
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. namespace App\Controller\v3;
  12. use App\Request\v3\UserRequest;
  13. use Hyperf\Di\Annotation\Inject;
  14. use App\Controller\BaseController;
  15. use App\Service\v3\Interfaces\CouponRecServiceInterface;
  16. class CouponController extends BaseController
  17. {
  18. /**
  19. * @Inject
  20. * @var CouponRecServiceInterface
  21. */
  22. protected $couponRecService;
  23. /**
  24. * 获取用户可领取优惠卷接口
  25. */
  26. public function getSystemCouponUserList()
  27. {
  28. }
  29. //统计用户
  30. public function userCouponAccount()
  31. {
  32. }
  33. /**
  34. * 用户领取优惠卷
  35. */
  36. public function userReceiveCoupon()
  37. {
  38. }
  39. /**
  40. * 获取用户已经领取的优惠卷列表
  41. */
  42. public function getUserReceiveCouponList()
  43. {
  44. }
  45. /**
  46. * 获取用户当前订单可用的优惠券列表
  47. * 按分类(1订单 等优惠)分组返回
  48. */
  49. public function getListByUser(UserRequest $request)
  50. {
  51. $userId = $this->request->input('user_id');
  52. $page = $this->request->input('page');
  53. $pagesize = $this->request->input('pagesize');
  54. $type = $this->request->input('type','1');
  55. /**
  56. * $type unused 未使用 used 已使用 expired已失效
  57. */
  58. $res['coupon_list'] = $this->couponRecService->getListByUser($userId,$type,$page,$pagesize);
  59. $res['statistics'] = $this->couponRecService->statistics($userId);
  60. return $this->success($res);
  61. }
  62. }