20 lines
444 B
PHP
20 lines
444 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Antadis\API\Front\Models\Sale as BaseSale;
|
|
use App\Classes\ImageTrait;
|
|
|
|
class Sale extends BaseSale {
|
|
use ImageTrait;
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function toArray() {
|
|
$sale = parent::toArray();
|
|
$is_active = strtotime($this->date_start) < strtotime(date('Y-m-d 07:00:00'));
|
|
$sale['img'] = $this->getSaleImage($this->id, $is_active);
|
|
return $sale;
|
|
}
|
|
}
|