feat: menu

This commit is contained in:
2024-10-27 23:45:20 +08:00
parent 5285dd6972
commit b828d48672
9 changed files with 226 additions and 10 deletions

View File

@@ -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();
}
}