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

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

class ActivityTransformer
{
    public function transform($activityItem)
    {
        return [
            'id' => $activityItem->id,
            'name' => $activityItem->name,
            'activity_page' => $activityItem->activity_page,
            'created_at' => $activityItem->created_at->toDateTimeString(),
            'start_time' => $activityItem->start_time,
            'end_time' => $activityItem->end_time,
            'price' => $activityItem->price,
            'orderCount' => $activityItem->orderCount,
            'totalChargeAmount' => $activityItem->totalChargeAmount,
            'successOrderCount' => $activityItem->successOrderCount,
            'pageUserNum' => $activityItem->pageUserNum,
            'is_reader_page_show' => $activityItem->is_reader_page_show,
            'is_sign_message_show' => $activityItem->is_sign_message_show,
            'successrate' => $activityItem->successrate,
            'is_over'=>$activityItem->is_over
        ];
    }
}