<?php
/**
 * Created by PhpStorm.
 * Date: 2017/3/31
 * Time: 14:02
 */

namespace App\Http\Controllers\Channel\Activity\Transformers;

class ActivityChargeInfoTransformer
{
    public function transform($activityChargeItem)
    {
        return [
            'uid' => $activityChargeItem->uid,
            'price' => (float)$activityChargeItem->price,
            'trade_no' => $activityChargeItem->trade_no,
            'pay_end_at' => $activityChargeItem->pay_end_at,
            'activity_id' => $activityChargeItem->activity_id,
            'send_order_id' => $activityChargeItem->send_order_id,
            'send_order_name' => $activityChargeItem->send_order_name,
            'created_at' => $activityChargeItem->created_at->toDateTimeString()
        ];
    }
}