我有以下功能:
class TariffFareController {
public static function checkRunin($fieldPickup) {
$runInThreshold = 5;
$fieldDestination = 6;
if ($fieldPickup > $runInThreshold && $fieldDestination > $runInThreshold)
{
if ($fieldPickup > $fieldDestination)
{
$distance = $fieldPickup - $runInThreshold;
} else {
$distance = $fieldDestination - $runInThreshold;
}
}
}
我想传递$distance
给这个函数:-
private static function getFare($int_terminate) {
//CODE
//eg// if($distance > 5) {
//do something
}
}
我怎样才能做到这一点?