UserCoupon.php 561 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\store\model;
  3. use app\common\model\UserCoupon as UserCouponModel;
  4. /**
  5. * 用户优惠券模型
  6. * Class UserCoupon
  7. * @package app\store\model
  8. */
  9. class UserCoupon extends UserCouponModel
  10. {
  11. /**
  12. * 获取优惠券列表
  13. * @return \think\Paginator
  14. * @throws \think\exception\DbException
  15. */
  16. public function getList()
  17. {
  18. return $this->with(['user'])
  19. ->order(['create_time' => 'desc'])
  20. ->paginate(15, false, [
  21. 'query' => request()->request()
  22. ]);
  23. }
  24. }