<?php
/**
 * Created by PhpStorm.
 * User: hp
 * Date: 2017/12/1
 * Time: 11:42
 */

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

class ChapterOrderTransformer
{
    public function transform($chapterOrderItem)
    {
        return [
            'id' => $chapterOrderItem->id,
            'distribution_channel_id' => $chapterOrderItem->distribution_channel_id,
            'bid' => $chapterOrderItem->bid,
            'cid' => $chapterOrderItem->cid,
            'chapter_name' => $chapterOrderItem->chapter_name,
            'book_name' => $chapterOrderItem->book_name,
            'uid' => $chapterOrderItem->uid,
            'u' => $chapterOrderItem->u,
            'fee' => $chapterOrderItem->fee,
            'send_order_id' => $chapterOrderItem->send_order_id,
            'charge_balance' => $chapterOrderItem->charge_balance,
            'reward_balance' => $chapterOrderItem->reward_balance,
            'created_at' => $chapterOrderItem->created_at->toDateTimeString(),
            'updated_at' => $chapterOrderItem->updated_at->toDateTimeString()
        ];
    }
}