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

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

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