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

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

class ActivityTransformer
{
    public function transform($activityItem)
    {
        return [
            'id' => $activityItem->id,
            'name' => $activityItem->name,
            'activity_page' => $activityItem->activity_page,
            'price' => $activityItem->price,
            'end_time' => $activityItem->end_time,
            'start_time' => $activityItem->start_time,
            'totalOrderCount' => $activityItem->totalOrderCount,
            'successOrderCount' => $activityItem->successOrderCount,
            'totalChargeAmount' => $activityItem->totalChargeAmount,
            'created_at' => $activityItem->created_at->toDateTimeString(),
            'given' => $activityItem->given,
        ];
    }
}