<?php

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

class BookPromotionCheckedTransformer
{
    public function transform($item)
    {
        return [
            'id' => $item->id,
            'book_id' => $item->book_id,
            'operator' => $item->operator,
            'size' => $item->size,
            'status' => $item->status,
            'author' => $item->author,
            'book_name' => $item->book_name,
            'cp_source' => $item->cp_source,
            'is_on_shelf' => $item->is_on_shelf,
            'periods'=>$item->periods,
            'recharge_amount_in_24h_outside' => $item->recharge_amount_in_24h_outside,
            'recharge_amount_in_24h_inside' => $item->recharge_amount_in_24h_inside,
            'recharge_amount_in_72h_inside' => $item->recharge_amount_in_72h_inside,
            'recharge_amount_in_72h_outside' => $item->recharge_amount_in_72h_outside,
            'created_at' => date("Y-m-d H:i:s", strtotime($item->onshelf_date))
        ];
    }
}