SystemRouteDao.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * +----------------------------------------------------------------------
  4. * | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  5. * +----------------------------------------------------------------------
  6. * | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
  7. * +----------------------------------------------------------------------
  8. * | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  9. * +----------------------------------------------------------------------
  10. * | Author: CRMEB Team <admin@crmeb.com>
  11. * +----------------------------------------------------------------------
  12. */
  13. namespace app\dao\system;
  14. use app\dao\BaseDao;
  15. use app\model\system\SystemRoute;
  16. /**
  17. * Class SystemRouteDao
  18. * @author 等风来
  19. * @email 136327134@qq.com
  20. * @date 2023/4/6
  21. * @package app\dao\system
  22. */
  23. class SystemRouteDao extends BaseDao
  24. {
  25. /**
  26. * @return string
  27. * @author 等风来
  28. * @email 136327134@qq.com
  29. * @date 2023/4/6
  30. */
  31. protected function setModel(): string
  32. {
  33. return SystemRoute::class;
  34. }
  35. /**
  36. * @param array $ids
  37. * @return bool
  38. * @author 等风来
  39. * @email 136327134@qq.com
  40. * @date 2023/4/23
  41. */
  42. public function deleteRoutes(array $ids)
  43. {
  44. return $this->getModel()::destroy(function ($q) use ($ids) {
  45. $q->whereIn('id', $ids);
  46. }, true);
  47. }
  48. }