feat: menu
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use App\Constants\Admin\AuthCode;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
|
||||
/**
|
||||
@@ -42,4 +43,12 @@ class AdminMenu extends Model
|
||||
|
||||
const UPDATED_AT = 'update_time';
|
||||
|
||||
/**
|
||||
* 获取所有
|
||||
* @return array
|
||||
*/
|
||||
public function getAllMenu(): array
|
||||
{
|
||||
return $this->where('status', AuthCode::MENU_STATUS_ENABLE)->orderBy('sort', 'desc')->get()->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user