'array', 'hou' => 'array', ]; protected $appends = [ 'result_time', ]; public function getResultTimeAttribute($key) { if ($this->updated_at) { return $this->updated_at; } return ''; } public function getCloseTime($earlySecond) { $time = strtotime($this->close_time); return date('Y-m-d H:i:s', $time - $earlySecond); } function getPrizePool() { // 匹配"亿"单位的数字,支持"7.99亿"格式 $pattern = '/(\d+(?:\.\d+)?)亿/'; $matches = []; if (preg_match($pattern, $this->prize, $matches)) { return floatval($matches[1]); } return 0; } }