...
|
...
|
@@ -121,24 +121,18 @@ class OrderController extends HomeBaseController{ |
|
|
$price=1;
|
|
|
//判断是否跨天
|
|
|
if ($endTime < $stateTime){
|
|
|
dump($hours_start_time);
|
|
|
if ($hours_end_time > $hours_start_time){
|
|
|
dump(date('Y-m-d H:i:s',$new_start_time));
|
|
|
if ($new_start_time> strtotime('00:00:00') && $new_start_time < $endTime && $new_end_time > $endTime && $new_end_time < $stateTime){
|
|
|
dump(date('Y-m-d H:i:s',$new_start_time));
|
|
|
$price=ceil(($endTime-$new_start_time)/3600) * $interval['price'] + ceil(($new_end_time-$endTime)/3600) * $cost['cost'];
|
|
|
}
|
|
|
if ($new_start_time> strtotime('00:00:00') && $new_start_time < $endTime && $new_end_time > $stateTime){
|
|
|
dump(date('Y-m-d H:i:s',$new_start_time));
|
|
|
$price=ceil(($endTime-$new_start_time)/3600) * $interval['price'] + ceil(($new_end_time-$stateTime)/3600) * $interval['price'] + ceil(($stateTime-$endTime)/3600) * $cost['cost'];
|
|
|
}
|
|
|
|
|
|
if ($new_start_time > $endTime && $new_end_time < $stateTime){
|
|
|
dump(date('Y-m-d H:i:s',$new_start_time));
|
|
|
$price=ceil(($new_end_time-$new_start_time)/3600) * $cost['cost'];
|
|
|
}
|
|
|
if ($new_start_time > $endTime && $new_end_time > $stateTime && $new_end_time < strtotime('24:00:00')){
|
|
|
dump(date('Y-m-d H:i:s',$new_start_time));
|
|
|
$price= ceil(($stateTime-$new_start_time)/3600) * $cost['cost'] + ceil(($new_end_time-$stateTime)/3600) * $interval['price'];
|
|
|
}
|
|
|
|
...
|
...
|
|