SystemRouteDao.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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\system;
  12. use app\dao\BaseDao;
  13. use app\model\system\SystemRoute;
  14. /**
  15. * Class SystemRouteDao
  16. * @author 等风来
  17. * @email 136327134@qq.com
  18. * @date 2023/4/6
  19. * @package app\dao\system
  20. */
  21. class SystemRouteDao extends BaseDao
  22. {
  23. /**
  24. * @return string
  25. * @author 等风来
  26. * @email 136327134@qq.com
  27. * @date 2023/4/6
  28. */
  29. protected function setModel(): string
  30. {
  31. return SystemRoute::class;
  32. }
  33. /**
  34. * @param array $ids
  35. * @return bool
  36. * @author 等风来
  37. * @email 136327134@qq.com
  38. * @date 2023/4/23
  39. */
  40. public function deleteRoutes(array $ids)
  41. {
  42. return $this->getModel()::destroy(function ($q) use ($ids) {
  43. $q->whereIn('id', $ids);
  44. }, true);
  45. }
  46. }