调整后台发货和动态记录表
This commit is contained in:
23
modules/User/Http/Resources/UserAndIdentityResource.php
Normal file
23
modules/User/Http/Resources/UserAndIdentityResource.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\User\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class UserAndIdentityResource extends JsonResource
|
||||
{
|
||||
public function toArray($request): array
|
||||
{
|
||||
|
||||
return [
|
||||
'user_id' => $this->id,
|
||||
'username' => $this->username,
|
||||
'nickname' => $this->info->nickname ?? '',
|
||||
'avatar' => $this->info->avatar ?? '',
|
||||
'identity' => [
|
||||
'name' => $this->identityFirst()->name,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user