- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
public function callCost($fromCity, $fromStreet, $fromHouse, $fromHousing, $fromBuilding, $fromPorch, $fromLat, $fromLon, $toCity, $toStreet, $toHouse, $toHousing, $toBuilding, $toPorch, $toLat, $toLon, $clientName, $phone, $priorTime, $customCarId, $customCar, $carType, $carGroupId, $tariffGroupId, $comment, $additional = '')
{
if ($json = $this->reqCache->getValue($fromLat . $fromLon . $toLat . $toLon . $phone . $priorTime . $tariffGroupId . $comment . $additional)) {
$data = json_decode($json);
return $data;
} else {
$tariffGroupId = $this->findTariffOnCarType($carType);
$additional = explode(';', $additional);
$route = new TaxiRouteAnalyzer($this->dbHost, $this->database, $this->dbLogin, $this->dbPass);
$this->writeLog($tariffGroupId);
$data = $route->analyzeRoute(1, $fromCity, $fromStreet, $fromHouse, $fromHousing, $fromLat, $fromLon, $toCity, $toStreet, $toHouse, $toHousing, $toLat, $toLon, $additional, $tariffGroupId, $this->isDay(), 1);
$res = json_encode($data);
$this->reqCache->setValue($fromLat . $fromLon . $toLat . $toLon . $phone . $priorTime . $tariffGroupId . $comment . $additional, $res, $this->cacheTime);
return $data;
}
}