first push

This commit is contained in:
ylyg5690
2025-07-01 19:39:13 +08:00
commit 5289483a8a
66 changed files with 10473 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
namespace app\common\service;
use app\model\User;
class UserService
{
public static function getInfo($userId)
{
$user = User::with('roles')->find($userId);
if (!$user) return null;
return [
'id' => $user->id,
'username' => $user->username,
'roles' => $user->roles->pluck('name')->toArray(),
// 可扩展其他字段
];
}
}