<?php
/**
 * Created by PhpStorm.
 * User: hp
 * Date: 2017/12/1
 * Time: 11:42
 */

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

class OrderStatTransformer
{
    public function transform($item)
    {
        return [
            'ticket_recharge_user_num' => (float)$item->ticket_recharge_pay_user_num,
            'year_recharge_user_num' => (float)$item->year_pay_user_num,
            'total_recharge_amount' => (float)$item->total_recharge_amount,
            'unpaid_num' => (float)$item->unpaid_num,
            'paid_num' => (float)$item->paid_num,
            'promotion_total_uv' => (float)$item->promotion_total_uv,
            'force_user_num' => (float)$item->force_user_num,
            'cost_sum'=>isset($item->cost_sum)?(float)$item->cost_sum:0
        ];
    }
}