<?php
/**
 * Created by PhpStorm.
 * User: tandunzhao
 * Date: 2017/11/17
 * Time: 下午4:40
 */

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


class PaymentTransformer
{
    public function transform($payment){
        return [
            'withdraw_cash_id' => $payment->withdraw_cash_id,
            'amount' => (float)($payment->amount),
            'amount_person' => (float)($payment->amount_person),
            'remark' => $payment->remark,
            'pay_time'   =>  date('Y-m-d H:i:s',strtotime($payment->pay_time)),
            'trade_no' => $payment->trade_no,
            'pay_merchant_source' => $payment->pay_merchant_source,
            'status' => $payment->status,
            'is_company' => (float) $payment->is_company,
            'pay_merchant_source_msg' => $payment->pay_merchant_source_msg,
            'pay_merchant_source_result' => $payment->pay_merchant_source_result,
        ];
    }
}