12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- /**
- * Created by PhpStorm.
- * User: tandunzhao
- * Date: 2017/12/26
- * Time: 下午5:37
- */
- namespace App\Http\Controllers\Manage\Channel\Transformers;
- class BusinessStatDataTransformer
- {
- public function transform($channelItem)
- {
- return [
- 'distribution_manages_id'=>(float)$channelItem->id,
- // 'distribution_manages_account'=>$channelItem->account,
- 'distribution_manages_nickname'=>$channelItem->nickname,
- 'distribution_manages_latest_login_time'=>isset($channelItem->latest_login_time) ? ($channelItem->latest_login_time ? date('Y-m-d H:i:s', strtotime($channelItem->latest_login_time)) : "") : "",
- 'distribution_manages_latest_login_ip'=>$channelItem->latest_login_ip,
- 'distribution_manages_is_enabled'=>(float)$channelItem->is_enabled,
- 'distribution_manages_remark'=>$channelItem->remark,
- 'distribution_manages_register_ip'=>$channelItem->register_ip,
- 'distribution_manages_create_time'=>isset($channelItem->created_at) ? ($channelItem->created_at ? date('Y-m-d H:i:s', strtotime($channelItem->created_at)) : "") : "",
- 'distribution_manages_update_time'=>isset($channelItem->updated_at) ? ($channelItem->updated_at ? date('Y-m-d H:i:s', strtotime($channelItem->updated_at)) : "") : "",
- 'distribution_manages_number'=>$channelItem->number,
- 'today_register_user_num'=>(float)$channelItem->today_register_user_num,
- 'yesterday_register_user_num'=>(float)$channelItem->yesterday_register_user_num,
- 'current_month_register_user_num'=>(float)$channelItem->current_month_register_user_num,
- 'last_month_register_user_num'=>(float)$channelItem->last_month_register_user_num,
- 'total_register_user_num'=>(float)$channelItem->total_register_user_num,
- 'total_send_order_num'=>(float)$channelItem->total_send_order_num,
- 'current_month_companies_num'=>(float)$channelItem->current_month_companies_num,
- 'current_month_channel_num'=>(float)$channelItem->current_month_channel_num,
- 'last_month_companies_num'=>(float)$channelItem->last_month_companies_num,
- 'last_month_channel_num'=>(float)$channelItem->last_month_channel_num,
- 'current_month_new_channels_recharge'=>(float)$channelItem->current_month_new_channels_recharge,
- 'current_month_channels_recharge'=>(float)$channelItem->current_month_channels_recharge,
- 'last_month_new_channels_recharge'=>(float)$channelItem->last_month_new_channels_recharge_sum,
- 'last_month_channels_recharge'=>(float)$channelItem->last_month_channels_recharge_sum,
- ];
- }
- }
|