29 lines
588 B
PHP
29 lines
588 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Resources\Json\ResourceCollection;
|
|
|
|
class WithdrawCollection extends ResourceCollection
|
|
{
|
|
/**
|
|
* 将资源集合转换成数组。
|
|
*
|
|
* @param \Illuminate\Http\Request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
$array = [];
|
|
|
|
foreach ($this->collection as $key => $item) {
|
|
$array[$key] = new WithdrawResource($item);
|
|
}
|
|
|
|
return [
|
|
'hasMore' => $this->resource->hasMorePages(),
|
|
'list' => $array,
|
|
];
|
|
}
|
|
}
|