SystemRouteCate.php 1.3 KB

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