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

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


class WithdrawCashTransformer
{
    public function transform($withdrawCash){
        return [
            'channel_id' => $withdrawCash->distribution_channel_id,
            'channel_name' => $withdrawCash->distribution_channel_name,
            'amount' => (float)($withdrawCash->amount),
            'pay_amount' => (float)($withdrawCash->amount - $withdrawCash->tallage),
            'tallage' => (float)($withdrawCash->tallage),
            'status'   =>  $withdrawCash->status,
            'serial_number'   =>  $withdrawCash->serial_number,
            'is_company'   =>  (float)$withdrawCash->is_company,
            'remark'   =>  $withdrawCash->remark,
            'check_user_id'   =>  $withdrawCash->check_user_id,
            'check_user_name'   =>  $withdrawCash->check_user_name,
            '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)),
        ];
    }
}