normalize-logging

This commit is contained in:
xiaomlove
2021-04-26 20:37:17 +08:00
parent 58c6aa58e8
commit 63a2c71cb6
18 changed files with 225 additions and 109 deletions
+7 -1
View File
@@ -9,6 +9,8 @@ use Illuminate\Http\Resources\Json\JsonResource;
class ExamUserResource extends JsonResource
{
public $preserveKeys = true;
/**
* Transform the resource into an array.
*
@@ -21,10 +23,14 @@ class ExamUserResource extends JsonResource
'id' => $this->id,
'status' => $this->status,
'status_text' => $this->statusText,
'created_at' => $this->created_at->format('Y-m-d H:i:s'),
'created_at' => formatDatetime($this->created_at),
'progress' => $this->when($this->progress, $this->progress),
'begin' => formatDatetime($this->begin),
'end' => formatDatetime($this->end),
'user' => new UserResource($this->whenLoaded('user')),
'exam' => new ExamResource($this->whenLoaded('exam')),
];
}
}