12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace app\model;
- use support\Model;
- class SysMenu extends Model
- {
- protected $table = 'sys_menu';
- protected $primaryKey = 'menu_id';
- protected $dateFormat = 'U';
- const CREATED_AT = 'menu_create_time';
- const UPDATED_AT = 'menu_update_time';
- /**
- * @Desc 获取父级
- * @Author Gorden
- * @Date 2024/3/12 14:13
- *
- * @param $pid
- * @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|object|null
- */
- public static function getParent($pid)
- {
- return self::where('menu_id',$pid)->first();
- }
- }
|