...
|
...
|
@@ -113,7 +113,6 @@ class OrderController extends HomeBaseController{ |
|
|
|
|
|
$new_start_time=$end_time-$yu;//时间戳
|
|
|
$new_end_time= $end_time;//时间戳
|
|
|
dump(date('Y-m-d H:i:s',$new_start_time));
|
|
|
$hours_start_time=date('H',$new_start_time);
|
|
|
$hours_end_time=date('H',$new_end_time);
|
|
|
|
...
|
...
|
@@ -122,18 +121,24 @@ class OrderController extends HomeBaseController{ |
|
|
$price=1;
|
|
|
//判断是否跨天
|
|
|
if ($endTime < $stateTime){
|
|
|
dump(date('Y-m-d H:i:s',$new_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'];
|
|
|
}
|
|
|
|
...
|
...
|
|