'array', 'sfgg_odds_last' => 'array', ]; protected $appends = [ 'close_datetime' ]; public function scopeSelling($query) { return $query->where('sale_state', SaleState::Selling); } public function getCloseTime($earlySecond) { $time = strtotime($this->close_time); return date('Y-m-d H:i:s', $time - $earlySecond); } public function getCloseDatetimeAttribute() { if (!$this->close_time) { return ''; } $hour = date('H', strtotime($this->close_time)); if ($hour >= 10) { return date('Y-m-d 10:00:00', strtotime($this->close_time)); } return date('Y-m-d 10:00:00', strtotime('-1 day', strtotime($this->close_time))); } }