<?php
/**
 * Created by PhpStorm.
 * User: tandunzhao
 * Date: 2017/12/26
 * Time: 下午5:37
 */

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


class BusinessChannelDayStatTransformer
{
    public function transform($channelItem)
    {
        return [
            'id' => $channelItem->id,
            'phone' => $channelItem->phone,
            'name' => $channelItem->name,
            'pay_merchant_id' => (float)$channelItem->pay_merchant_id,
            'nickname' => $channelItem->nickname,
            'latest_login_time'   =>  isset($channelItem->latest_login_time) ? date("Y-m-d H:i:s",strtotime($channelItem->latest_login_time)) : "",
            'latest_login_ip' => $channelItem->latest_login_ip,
            'is_enabled' => $channelItem->is_enabled,
            'remark' => $channelItem->remark,
            'register_ip' => $channelItem->register_ip,
            'person_in_charge_name'=>$channelItem->person_in_charge_name,
            'create_time'   =>  isset($channelItem->created_at) ? date("Y-m-d H:i:s",strtotime($channelItem->created_at)) : "",
            'distribution_manages_id'=>(float)$channelItem->distribution_manages_id,
//            'distribution_manages_account'=>$channelItem->distribution_manages_account,
            'distribution_manages_number'=>$channelItem->distribution_manages_number,
            'distribution_manages_nickname'=>$channelItem->distribution_manages_nickname,
            'business_channel_day_stats_date'   =>  isset($channelItem->business_channel_day_stats_date) ? date("Y-m-d",strtotime($channelItem->business_channel_day_stats_date)) : "",
            'business_channel_day_stats_register_user_num'   =>  (float)$channelItem->business_channel_day_stats_register_user_num,
            'business_channel_day_stats_send_order_num'   =>  (float)$channelItem->business_channel_day_stats_send_order_num,
        ];
    }

}