WithDrawLogModel.php 756 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class WithDrawLogModel extends Model
  5. {
  6. protected $name = 'withdraw_log';
  7. /**
  8. * 关联user
  9. * @return \think\model\relation\BelongsTo
  10. */
  11. public function user ()
  12. {
  13. return $this->belongsTo('app\common\model\UserModel', 'uid', 'id');
  14. }
  15. /**
  16. * 记录
  17. * @param $param
  18. * @return array
  19. * @throws \think\db\exception\DbException
  20. */
  21. public function getLog ($param)
  22. {
  23. $data = self::where('uid', $param->uid)
  24. ->field('practical_money,create_at,status,fail_log')
  25. ->order('create_at', 'desc')
  26. ->paginate($param->data['limit'])
  27. ->toArray();
  28. return $data['data'];
  29. }
  30. }