SystemRouteCate.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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\model\system;
  14. use crmeb\basic\BaseModel;
  15. class SystemRouteCate extends BaseModel
  16. {
  17. /**
  18. * @var string
  19. */
  20. protected $name = 'system_route_cate';
  21. /**
  22. * @var string
  23. */
  24. protected $pk = 'id';
  25. protected $autoWriteTimestamp = false;
  26. /**
  27. * @return \think\model\relation\HasMany
  28. * @author 等风来
  29. * @email 136327134@qq.com
  30. * @date 2023/4/7
  31. */
  32. public function children()
  33. {
  34. return $this->hasMany(SystemRoute::class, 'cate_id', 'id')->field(['id', 'type', 'cate_id', 'name', 'name as real_name', 'path', 'method'])->order('add_time desc');
  35. }
  36. }