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

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


class OfficialAccountBillsTransformer
{
    public function transform($item)
    {
        return [
            "amount" => $item->recharge_amount,
            "date" => $item->date,
            "appid" => $item->appid,
            "nickname" => $item->nickname,
            "total" => $item->channel_recharge_amount,
            'recharge_amount_in_30_days' => $item->recharge_amount_in_30_days ? $item->recharge_amount_in_30_days : 0,
            'recharge_amount_in_60_days' => $item->recharge_amount_in_60_days ? $item->recharge_amount_in_60_days : 0,
            'recharge_amount_in_90_days' => $item->recharge_amount_in_90_days ? $item->recharge_amount_in_90_days : 0,
            'new_fans_num' => $item->new_fans_num ? $item->new_fans_num : 0
        ];
    }
}