UserCancelDao.php 822 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\dao\user;
  3. use app\dao\BaseDao;
  4. use app\model\user\UserCancel;
  5. class UserCancelDao extends BaseDao
  6. {
  7. /**
  8. * @return string
  9. */
  10. protected function setModel(): string
  11. {
  12. return UserCancel::class;
  13. }
  14. /**
  15. * 获取列表
  16. * @param $where
  17. * @param int $page
  18. * @param int $limit
  19. * @return array
  20. * @throws \think\db\exception\DataNotFoundException
  21. * @throws \think\db\exception\DbException
  22. * @throws \think\db\exception\ModelNotFoundException
  23. */
  24. public function getList($where, $page = 0, $limit = 0)
  25. {
  26. return $this->search($where)->with(['user'])
  27. ->when($page && $limit, function ($query) use ($page, $limit) {
  28. $query->page($page, $limit);
  29. })->select()->toArray();
  30. }
  31. }