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.
32 lines
956 B
32 lines
956 B
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use App\Models\DictionaryT;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class EmployeeRewardPunishment extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'employee_id' => $this->employee_id,
|
|
'type' => $this->type,
|
|
'date' => $this->date,
|
|
'type_txt' => DictionaryT::getDictValue('REWARD_TYPE', $this->type),
|
|
'price' => $this->price,
|
|
'remark' => $this->remark,
|
|
'status' => $this->status,
|
|
'status_txt' => DictionaryT::getDictValue('REWARD_STATUS', $this->status),
|
|
'created_at' => $this->created_at->toDateTimeString(),
|
|
'updated_at' => $this->updated_at->toDateTimeString(),
|
|
];
|
|
}
|
|
}
|
|
|