PointsLog.php 801 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. *
  4. * @copyright ©2020 点小铺
  5. * @author hanj
  6. * @link: https://dyuit.com
  7. * Created by VSCode
  8. */
  9. namespace app\api\model\user;
  10. use app\common\model\user\PointsLog as PointsLogModel;
  11. /**
  12. * 用户余额变动明细模型
  13. * Class PointsLog
  14. * @package app\api\model\user
  15. */
  16. class PointsLog extends PointsLogModel
  17. {
  18. /**
  19. * 获取日志明细列表
  20. * @param $userId
  21. * @return \think\Paginator
  22. * @throws \think\exception\DbException
  23. */
  24. public function getList($userId)
  25. {
  26. // 获取列表数据
  27. return $this->where('user_id', '=', $userId)
  28. ->order(['create_time' => 'desc'])
  29. ->paginate(15, false, [
  30. 'query' => \request()->request()
  31. ]);
  32. }
  33. }