<?php

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

class CustomSendMsgsTransformers
{
    public function transform($customSendMsgs){
        return [
            'id'       =>  $customSendMsgs->id,
            'appid'       =>  $customSendMsgs->appid,
            'official_account_name'       =>  isset($customSendMsgs->official_account_name)?$customSendMsgs->official_account_name:'',
            'name'       =>  $customSendMsgs->name,
            'send_time'       =>  $customSendMsgs->send_time,
            'content'       =>  $customSendMsgs->content,
            'redirect_url'       =>  $customSendMsgs->redirect_url,
            'status'       =>  $customSendMsgs->status,
            'distribution_channel_id'       =>  $customSendMsgs->distribution_channel_id,
            'subscribe_time'       =>  $customSendMsgs->subscribe_time,
            'sex'       =>  $customSendMsgs->sex,
            'balance'       =>  $customSendMsgs->balance,
            'order_type'       =>  $customSendMsgs->order_type,
            'category_id'       =>  $customSendMsgs->category_id,
            'user_num'       =>  $customSendMsgs->user_num,
            'is_full_send'       =>  $customSendMsgs->is_full_send,
            'trusteeship'       =>  $customSendMsgs->trusteeship,
            'batch_no'       =>   isset($customSendMsgs->batch_no)?$customSendMsgs->batch_no:'',
            'position'       =>   isset($customSendMsgs->position)?$customSendMsgs->position:'',
            'book_names'       =>   isset($customSendMsgs->book_names)?$customSendMsgs->book_names:'',
            'bids'       =>   isset($customSendMsgs->bids)?$customSendMsgs->bids:'',
            'suc_order_num'       =>   isset($customSendMsgs->suc_order_num)?$customSendMsgs->suc_order_num:'',
            'total_order_num'       =>   isset($customSendMsgs->total_order_num)?$customSendMsgs->total_order_num:'',
            'order_suc_rate'       =>   isset($customSendMsgs->order_suc_rate)?$customSendMsgs->order_suc_rate:'',
            'success_order_sum'       =>   isset($customSendMsgs->success_order_sum)?$customSendMsgs->success_order_sum:'',
            'pv'       =>  isset($customSendMsgs->pv)?$customSendMsgs->pv:'0',
            'uv'       =>  isset($customSendMsgs->uv)?$customSendMsgs->uv:'0',
        ];
    }
}