SysMenu.php 606 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace app\model;
  3. use support\Model;
  4. class SysMenu extends Model
  5. {
  6. protected $table = 'sys_menu';
  7. protected $primaryKey = 'menu_id';
  8. protected $dateFormat = 'U';
  9. const CREATED_AT = 'menu_create_time';
  10. const UPDATED_AT = 'menu_update_time';
  11. /**
  12. * @Desc 获取父级
  13. * @Author Gorden
  14. * @Date 2024/3/12 14:13
  15. *
  16. * @param $pid
  17. * @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|object|null
  18. */
  19. public static function getParent($pid)
  20. {
  21. return self::where('menu_id',$pid)->first();
  22. }
  23. }