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

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


class PaymentDetailTransformer
{
    public function transform($payment){
        return [
            'id'=>$payment->id,
            'withdraw_cash_id' => $payment->cash_id,
            'amount' => (float)($payment->amount),
            'amount_person' => (float)($payment->amount_person),
            'withdraw_cashes_amount' => (float)($payment->withdraw_cashes_amount),
            'withdraw_cashes_tallage' => (float)($payment->withdraw_cashes_tallage),
            '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->payments_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,
            'channel_id' => $payment->channel_id,
            'channel_name' => $payment->channel_name,
            'status' => $payment->wc_status,
            'remark' => $payment->remark,
            'check_user_id' => $payment->check_user_id,
            'check_user_name' => $payment->check_user_name,
            'account_name' => $payment->account_name,
            'identity_card' => $payment->identity_card,
            'card_number' => $payment->card_number,
            'account_bank' => $payment->account_bank,
            'bank' => $payment->bank,
            'province' => $payment->province
        ];
    }
}