BalanceLog.php 767 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace app\api\model\user;
  3. use app\common\model\user\BalanceLog as BalanceLogModel;
  4. /**
  5. * 用户余额变动明细模型
  6. * Class BalanceLog
  7. * @package app\api\model\user
  8. */
  9. class BalanceLog extends BalanceLogModel
  10. {
  11. /**
  12. * 隐藏字段
  13. * @var array
  14. */
  15. protected $hidden = [
  16. 'wxapp_id',
  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. }