<?php

namespace App\Http\Controllers\Wap\Advertise\Transformers;

class AdvertiseTransformer
{
    public function transform($order){
        return [
            'merchant_order_id'       =>  $order->merchant_order_id,
            'user_id'       =>  $order->user_id,
            'user_nickname'       =>  $order->user_nickname,
            'pay_money'       =>  (int)$order->pay_money/100,
            'pay_flag'   =>  $order->pay_flag,
            'pay_time'   =>  $order->pay_time ? date('Y-m-d H:i:s',$order->pay_time) : '',
            'send_order_id' => isset($order->send_order_id) ? $order->send_order_id : 0,
            'send_order_name' => isset($order->send_order_name) ? $order->send_order_name : ''
        ];
    }
}