You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
718 B
30 lines
718 B
<?php
|
|
|
|
namespace App\Http\Resources\Registration\Schedule;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class DeptListsResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request = null): array
|
|
{
|
|
$this->resource = xmlArrayToListByKey($this->resource, 'ITEM');
|
|
|
|
$lists = [];
|
|
foreach ($this->resource['ITEM'] as $v) {
|
|
$lists[] = [
|
|
'dept_id' => $v['DEPID'],
|
|
'dept_name' => $v['DEPNAME'],
|
|
'dept_intro' => $v['INTRODUCE']
|
|
];
|
|
}
|
|
|
|
return $lists;
|
|
}
|
|
}
|
|
|