<?php

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

class WechatKeyWordsMsgTransformer
{
    public function transform($wechatKeywordsMsg){
        return [
            'id'       =>  $wechatKeywordsMsg->id,
            'keyword'       =>  $wechatKeywordsMsg->keyword,
            'distribution_channel_id'       =>  $wechatKeywordsMsg->distribution_channel_id,
            'bid'       =>  $wechatKeywordsMsg->bid,
            'cid'       =>  $wechatKeywordsMsg->cid,
            'appids'       =>  $wechatKeywordsMsg->appids,
            'status'       =>  $wechatKeywordsMsg->status,
            'book_name'       =>  $wechatKeywordsMsg->book_name,
            'chapter_name'       =>  $wechatKeywordsMsg->chapter_name,
            'send_title'       =>  isset($wechatKeywordsMsg->send_title)?$wechatKeywordsMsg->send_title:'',
            'send_cover'       =>  isset($wechatKeywordsMsg->send_cover)?$wechatKeywordsMsg->send_cover:'',
            'click_num'       =>  isset($wechatKeywordsMsg->click_num)?$wechatKeywordsMsg->click_num:'0',
            'uv'       =>  isset($wechatKeywordsMsg->uv)?$wechatKeywordsMsg->uv:'0',
            'new_subscribe_num'       =>  isset($wechatKeywordsMsg->new_subscribe_num)?$wechatKeywordsMsg->new_subscribe_num:'0',
            'charge_amount'       =>  isset($wechatKeywordsMsg->charge_amount)?$wechatKeywordsMsg->charge_amount:'0',
        ];
    }
}