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

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

class OrderTransformer
{
    public function transform($orderItem)
    {
        return [
            'id' => $orderItem->id,
            'distribution_channel_id' => $orderItem->distribution_channel_id,
            'channel_name' => $orderItem->channel_name,
            'uid' => $orderItem->uid,
            'product_id' => $orderItem->product_id,
            'price' => $orderItem->price,
            'status' => $orderItem->status,
            'pay_type' => $orderItem->pay_type,
            'trade_no' => $orderItem->trade_no,
            'servicer' => $orderItem->servicer,
            'transaction_id' => $orderItem->transaction_id,
            'pay_end_at' => $orderItem->pay_end_at,
            'create_ip' => $orderItem->create_ip,
            'offical_account_nick_name'=>$orderItem->offical_account_nick_name,
            'send_order_id' => $orderItem->send_order_id,
            'send_order_name' => $orderItem->send_order_name,
            'created_at' => $orderItem->created_at->toDateTimeString(),
            'updated_at' => $orderItem->updated_at->toDateTimeString()
        ];
    }
}