阶段更新
This commit is contained in:
28
app/Api/Resources/Area/AreaCodeCollection.php
Normal file
28
app/Api/Resources/Area/AreaCodeCollection.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Api\Resources\Area;
|
||||
|
||||
use App\Api\Resources\BaseCollection;
|
||||
use App\Api\Resources\User\UserBaseResource;
|
||||
|
||||
class AreaCodeCollection extends BaseCollection
|
||||
{
|
||||
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'data' => $this->collection->map(function ($info) {
|
||||
return [
|
||||
'area_code' => $info->id,
|
||||
'user' => new UserBaseResource($info->user),
|
||||
'status' => [
|
||||
'status' => $info->status,
|
||||
'text' => $info->status_text,
|
||||
],
|
||||
];
|
||||
}),
|
||||
'page' => $this->page(),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user