UserCancelDao.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\dao\user;
  12. use app\dao\BaseDao;
  13. use app\model\user\UserCancel;
  14. class UserCancelDao extends BaseDao
  15. {
  16. /**
  17. * @return string
  18. */
  19. protected function setModel(): string
  20. {
  21. return UserCancel::class;
  22. }
  23. /**
  24. * 获取列表
  25. * @param $where
  26. * @param int $page
  27. * @param int $limit
  28. * @return array
  29. * @throws \think\db\exception\DataNotFoundException
  30. * @throws \think\db\exception\DbException
  31. * @throws \think\db\exception\ModelNotFoundException
  32. */
  33. public function getList($where, $page = 0, $limit = 0)
  34. {
  35. return $this->search($where)->with(['user'])
  36. ->when($page && $limit, function ($query) use ($page, $limit) {
  37. $query->page($page, $limit);
  38. })->select()->toArray();
  39. }
  40. }