BalanceLog.php 921 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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\BalanceLog as BalanceLogModel;
  11. /**
  12. * 用户余额变动明细模型
  13. * Class BalanceLog
  14. * @package app\api\model\user
  15. */
  16. class BalanceLog extends BalanceLogModel
  17. {
  18. /**
  19. * 隐藏字段
  20. * @var array
  21. */
  22. protected $hidden = [
  23. 'wxapp_id',
  24. ];
  25. /**
  26. * 获取账单明细列表
  27. * @param $userId
  28. * @return \think\Paginator
  29. * @throws \think\exception\DbException
  30. */
  31. public function getList($userId)
  32. {
  33. // 获取列表数据
  34. return $this->where('user_id', '=', $userId)
  35. ->order(['create_time' => 'desc'])
  36. ->paginate(15, false, [
  37. 'query' => request()->request()
  38. ]);
  39. }
  40. }