UserCoupon.php 670 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. *
  4. * @copyright ©2020 点小铺
  5. * @author hanj
  6. * @link: https://dyuit.com
  7. * Created by VSCode
  8. */
  9. namespace app\store\model;
  10. use app\common\model\UserCoupon as UserCouponModel;
  11. /**
  12. * 用户优惠券模型
  13. * Class UserCoupon
  14. * @package app\store\model
  15. */
  16. class UserCoupon extends UserCouponModel
  17. {
  18. /**
  19. * 获取优惠券列表
  20. * @return \think\Paginator
  21. * @throws \think\exception\DbException
  22. */
  23. public function getList()
  24. {
  25. return $this->with(['user'])
  26. ->order(['create_time' => 'desc'])
  27. ->paginate(15, false, [
  28. 'query' => request()->request()
  29. ]);
  30. }
  31. }