<?php


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

class SmartPushBookTransformer
{
    public function transform($book)
    {
        return [
            'book_id' => $book->bid,
            'book_name' => $book->book_name,
            'update_time' => isset($book->updated_at) ? date('Y-m-d H:i:s',strtotime($book->updated_at)):'',
            'is_on_shelf' => $book->is_on_shelf,
            'test_status'=>isset($book->test_status) ? $book->test_status:'',
            'test_update_time'=>isset($book->test_update_time) ? date('Y-m-d H:i:s',strtotime($book->test_update_time)):'',
            'plan_push_user_num'=>isset($book->plan_push_user_num) ? $book->plan_push_user_num:'',
            'real_push_user_num'=>isset($book->real_push_user_num) ? $book->real_push_user_num:'',
            'uv'=>isset($book->uv) ? $book->uv:'',
            'pv'=>isset($book->pv) ? $book->pv:'',
            'charge_amount'=>isset($book->charge_amount) ? $book->charge_amount:'',
            'charge_user_num'=>isset($book->charge_user_num) ? $book->charge_user_num:'',
            'book_amount'=>isset($book->book_amount) ? $book->book_amount:'',
            'book_user_num'=>isset($book->book_user_num) ? $book->book_user_num:'',
            'second_chapter_uv'=>isset($book->second_chapter_uv) ? $book->second_chapter_uv:'',
        ];
    }
}