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

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


class CashAccountTransformer
{
    public function transform($cashAccount){
        return [
            'account_name'       =>  isset($cashAccount->account_name) ? $cashAccount->account_name : "",
            'identity_card'       =>  isset($cashAccount->identity_card) ? $cashAccount->identity_card : "",
            'card_number'   =>  isset($cashAccount->card_number) ? $cashAccount->card_number : "",
            'account_bank'   => isset($cashAccount->account_bank) ? $cashAccount->account_bank : "",
            'bank_id'   =>  (float)(isset($cashAccount->bank_id) ? $cashAccount->bank_id : 0),
            'is_company'   =>  (float)(isset($cashAccount->is_company) ? $cashAccount->is_company : 0),
            'bank'   =>  isset($cashAccount->bank) ? $cashAccount->bank : "",
            'status'   =>  isset($cashAccount->status) ? $cashAccount->status : "",
            'province'   =>  isset($cashAccount->province) ? $cashAccount->province : "",
            'updated_time'   =>  isset($cashAccount->updated_at) ? date("Y-m-d H:i:s",strtotime($cashAccount->updated_at)) : "",
        ];
    }

}