today = Db::getRow('select RUB, USD, from_unixtime(id, ?) as date from ekr_exchange_rates order by id desc limit 1', ['%d.%m.%Y']); if (empty($this->today)) { $this->today = ['RUB' => 0, 'USD' => 0, 'date' => '00.00.0000']; } } public function oneEkrInUSD(): float { return round($this->today['RUB'] / $this->today['USD'], 2); } public function oneEkrInRUB(): float { return $this->today['RUB']; } public function date(): string { return $this->today['date']; } }