作者 董瑞恩
1 个管道 的构建 通过 耗费 0 秒

interface

... ... @@ -139,23 +139,23 @@ class OrderController extends HomeBaseController{
if ($hours_end_time > $hours_start_time){
//在预设时间段左边并不与之重合
if (($new_start_time > strtotime('00:00:00') && $new_start_time < $endTime) && ($new_end_time > $new_start_time && $new_end_time < $endTime)){
echo 1;
dump('1');
$price +=(ceil(($new_end_time-$new_start_time)/3600) * $interval['price']);
}
//与预设时间段的尾部重合
if (($new_start_time > strtotime('00:00:00') && $new_start_time < $endTime) && ($new_end_time > $endTime && $new_end_time < $stateTime)){
echo 2;
dump('2');
$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){
echo 3;
dump('3');
$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_start_time < $stateTime) && ($new_end_time < $new_start_time && $new_end_time < $stateTime)){
//存在首小时免费
echo 4;
dump('4');
echo $new_end_time;
echo $new_start_time;
$price +=(ceil(($new_end_time-$new_start_time)/3600) * $cost['cost']);
... ... @@ -167,7 +167,7 @@ class OrderController extends HomeBaseController{
//与预设时间段的头部重合
if (($new_start_time > $endTime && $new_start_time < $stateTime) && ($new_end_time > $stateTime && $new_end_time < strtotime('24:00:00'))){
//存在首小时免费
echo 5;
dump('5');
$price += (ceil(($stateTime-$new_start_time)/3600) * $cost['cost'] + ceil(($new_end_time-$stateTime)/3600) * $interval['price']);
if ($free==1 && $is_free==0){
$price-=$cost['cost'];
... ... @@ -176,7 +176,7 @@ class OrderController extends HomeBaseController{
}
//在预设时间段右边并不与之重合
if (($new_start_time > $stateTime && $new_start_time < strtotime('24:00:00')) && ($new_end_time > $new_start_time && $new_end_time < strtotime('24:00:00'))){
echo 6;
dump('6');
$price +=(ceil(($new_end_time-$new_start_time)/3600) * $interval['price']);
}
... ...