<?php

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

class SuspendBookTransformer
{
    public function transform($item)
    {
        return [
            'bid' => $item->id,
            'book_name' => $item->name,
            'pid'=>$item->pid,
            'suspend_time'=>$item->updated_at,
            'suspend_hours'=>round((time()-strtotime($item->updated_at))/3600,1),
            'suspend_days'=>round((time()-strtotime($item->updated_at))/(3600*24),1),
            'channel'=>($item->pid==1)?'男频':'女频'
        ];
    }
}