Room 時間格式錯誤 20250627
This commit is contained in:
parent
16d0cc67b6
commit
b6b0173ae4
@ -80,4 +80,18 @@ class Room extends Model
|
|||||||
public function statusLogs() {
|
public function statusLogs() {
|
||||||
return $this->hasMany(RoomStatusLog::class);
|
return $this->hasMany(RoomStatusLog::class);
|
||||||
}
|
}
|
||||||
|
public function toArray()
|
||||||
|
{
|
||||||
|
$array = parent::toArray();
|
||||||
|
|
||||||
|
if ($this->started_at) {
|
||||||
|
$array['started_at'] = $this->started_at->timezone('Asia/Taipei')->format('Y-m-d H:i:s');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->ended_at) {
|
||||||
|
$array['ended_at'] = $this->ended_at->timezone('Asia/Taipei')->format('Y-m-d H:i:s');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $array;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user