...
|
...
|
@@ -105,11 +105,25 @@ class OrderController extends HomeBaseController{ |
|
|
$cost=Db::name('cost')->where('id',1)->find();
|
|
|
$interval = Db::name('interval')->where('id',1)->find();
|
|
|
|
|
|
$stateTime=strtotime(date('H:i:s',$interval['start_time']));
|
|
|
$endTime=strtotime(date('H:i:s',$interval['end_time']));
|
|
|
|
|
|
//判断是否跨天
|
|
|
if ($endTime < $stateTime){
|
|
|
$stateTime-=86400;
|
|
|
}
|
|
|
dump($stateTime);
|
|
|
dump($endTime);
|
|
|
//不跨天处理方法
|
|
|
|
|
|
|
|
|
|
|
|
//判断是否在时间段内
|
|
|
$interval['start_time'];
|
|
|
if ($end_time > $interval['start_time'] && $end_time < $interval['end_time']){
|
|
|
//全部处于时间段中
|
|
|
if ($start_time > $interval['start_time']){
|
|
|
|
|
|
$time=ceil(($end_time-$start_time)/3600);
|
|
|
$price=$time*$interval['price'];
|
|
|
}else if ($start_time < $interval['start_time']){
|
|
|
|
|
|
}
|
...
|
...
|
@@ -119,7 +133,6 @@ class OrderController extends HomeBaseController{ |
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
$price=1;
|
|
|
return $price;
|
|
|
}
|
...
|
...
|
|