12345678910111213141516171819202122232425 |
- <?php
- namespace App\Http\Resources;
- use Illuminate\Http\Resources\Json\JsonResource;
- class RefundLogResource extends JsonResource
- {
- /**
- * Transform the resource into an array.
- *
- * @param \Illuminate\Http\Request $request
- * @return array
- */
- public function toArray($request)
- {
- $model = $this->resource;
- $data = [
- 'nickname' => $model->users->nickname ? ($model->users->nickname . "(" . $model->users->truename . ")") : '',
- 'mobile' => $model->users->mobile ?? '',
- 'area_name' => $model->area->name ?? '',
- ];
- return array_merge(parent::toArray($request),$data);
- }
- }
|