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

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


class WithdrawCashFinancialTransformer
{
    public function transform($withdrawCash){
        return [
            'id' => $withdrawCash->id,
//            'channel_id' => $withdrawCash->channel_id,
//            'channel_name' => $withdrawCash->channel_name,
            'amount' => (float)($withdrawCash->amount),
            'pay_amount' => (float)($withdrawCash->amount - $withdrawCash->tallage),
            'status'   =>  $withdrawCash->wc_status,
            'remark'   =>  $withdrawCash->remark,
//            'serial_number'   =>  $withdrawCash->serial_number,
//            'is_company'   =>  (float)$withdrawCash->is_company,
            'check_user_id'   =>  $withdrawCash->check_user_id,
            'check_user_name'   =>  $withdrawCash->check_user_name,
            'account_name' => $withdrawCash->account_name,
            'identity_card' => $withdrawCash->identity_card,
            'card_number' => $withdrawCash->card_number,
            'account_bank' => $withdrawCash->account_bank,
            'bank' => $withdrawCash->bank,
            'province' => $withdrawCash->province,
            'created_time'   =>  date('Y-m-d H:i:s',strtotime($withdrawCash->created_at)),
            'updated_time'   =>  date('Y-m-d H:i:s',strtotime($withdrawCash->updated_at)),
            'tallage' => (float)($withdrawCash->tallage),
            'is_frozen' => $withdrawCash->is_frozen,
            'fc_remark' => $withdrawCash->fc_remark
        ];
    }
}