'array', 'spf_odds_last' => 'array', 'rq_odds' => 'array', 'rq_odds_last' => 'array', 'jq_odds' => 'array', 'jq_odds_last' => 'array', 'bqc_odds' => 'array', 'bqc_odds_last' => 'array', 'bf_odds' => 'array', 'bf_odds_last' => 'array', 'sxpds_odds' => 'array', 'sxpds_odds_last' => 'array', ]; protected $appends = [ 'close_datetime' ]; public function scopeSelling($query) { return $query->where('sale_state', SaleState::Selling); } public function score() { return $this->belongsTo(JczqScore::class, 'match_id', 'match_id'); } public function match() { return $this->belongsTo(ZqMatch::class, 'match_id', 'match_id'); } 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))); } }