1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-07-16 05:12:19 +08:00

完善shallowUserInfo处理逻辑

This commit is contained in:
koogua 2021-10-06 18:39:50 +08:00
parent d94001a4a4
commit 93279a53e2

View File

@ -29,10 +29,14 @@ trait UserTrait
public function handleShallowUserInfo($id)
{
if (empty($id)) return new \stdClass();
$userRepo = new UserRepo();
$user = $userRepo->findShallowUserById($id);
if (!$user) return new \stdClass();
$result = $user->toArray();
$result['avatar'] = kg_cos_user_avatar_url($user->avatar);