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

interface

@@ -137,29 +137,25 @@ class OrderController extends HomeBaseController{ @@ -137,29 +137,25 @@ class OrderController extends HomeBaseController{
137 if ($endTime < $stateTime){ 137 if ($endTime < $stateTime){
138 //设备使用时间段是否跨天(不跨天) 138 //设备使用时间段是否跨天(不跨天)
139 if ($hours_end_time > $hours_start_time){ 139 if ($hours_end_time > $hours_start_time){
140 - dump(date('Y-m-d H:i:s',$new_start_time));  
141 - dump(date('Y-m-d H:i:s',$new_end_time));  
142 - dump(date('Y-m-d H:i:s',$stateTime));  
143 - dump(date('Y-m-d H:i:s',$endTime)); 140 +// dump(date('Y-m-d H:i:s',$new_start_time));
  141 +// dump(date('Y-m-d H:i:s',$new_end_time));
  142 +// dump(date('Y-m-d H:i:s',$stateTime));
  143 +// dump(date('Y-m-d H:i:s',$endTime));
144 //在预设时间段左边并不与之重合 144 //在预设时间段左边并不与之重合
145 if (($new_start_time > strtotime('00:00:00') && $new_start_time < $endTime) && ($new_end_time > $new_start_time && $new_end_time < $endTime)){ 145 if (($new_start_time > strtotime('00:00:00') && $new_start_time < $endTime) && ($new_end_time > $new_start_time && $new_end_time < $endTime)){
146 - dump('1');  
147 $price +=(ceil(($new_end_time-$new_start_time)/3600) * $interval['price']); 146 $price +=(ceil(($new_end_time-$new_start_time)/3600) * $interval['price']);
148 } 147 }
149 //与预设时间段的尾部重合 148 //与预设时间段的尾部重合
150 if (($new_start_time > strtotime('00:00:00') && $new_start_time < $endTime) && ($new_end_time > $endTime && $new_end_time < $stateTime)){ 149 if (($new_start_time > strtotime('00:00:00') && $new_start_time < $endTime) && ($new_end_time > $endTime && $new_end_time < $stateTime)){
151 - dump('2');  
152 $price +=(ceil(($endTime-$new_start_time)/3600) * $interval['price'] + ceil(($new_end_time-$endTime)/3600) * $cost['cost']); 150 $price +=(ceil(($endTime-$new_start_time)/3600) * $interval['price'] + ceil(($new_end_time-$endTime)/3600) * $cost['cost']);
153 } 151 }
154 //与预设时间段的头尾都重合 152 //与预设时间段的头尾都重合
155 if (($new_start_time > strtotime('00:00:00') && $new_start_time < $endTime) && $new_end_time > $stateTime){ 153 if (($new_start_time > strtotime('00:00:00') && $new_start_time < $endTime) && $new_end_time > $stateTime){
156 - dump('3');  
157 $price +=(ceil(($endTime-$new_start_time)/3600) * $interval['price'] + ceil(($new_end_time-$stateTime)/3600) * $interval['price'] + ceil(($stateTime-$endTime)/3600) * $cost['cost']); 154 $price +=(ceil(($endTime-$new_start_time)/3600) * $interval['price'] + ceil(($new_end_time-$stateTime)/3600) * $interval['price'] + ceil(($stateTime-$endTime)/3600) * $cost['cost']);
158 } 155 }
159 //不与预设时间段重合 156 //不与预设时间段重合
160 if (($new_start_time > $endTime && $new_start_time < $stateTime) && ($new_end_time > $new_start_time && $new_end_time < $stateTime)){ 157 if (($new_start_time > $endTime && $new_start_time < $stateTime) && ($new_end_time > $new_start_time && $new_end_time < $stateTime)){
161 //存在首小时免费 158 //存在首小时免费
162 - dump('4');  
163 $price +=(ceil(($new_end_time-$new_start_time)/3600) * $cost['cost']); 159 $price +=(ceil(($new_end_time-$new_start_time)/3600) * $cost['cost']);
164 if ($free==1 && $is_free==0){ 160 if ($free==1 && $is_free==0){
165 $price-=$cost['cost']; 161 $price-=$cost['cost'];
@@ -169,7 +165,6 @@ class OrderController extends HomeBaseController{ @@ -169,7 +165,6 @@ class OrderController extends HomeBaseController{
169 //与预设时间段的头部重合 165 //与预设时间段的头部重合
170 if (($new_start_time > $endTime && $new_start_time < $stateTime) && ($new_end_time > $stateTime && $new_end_time < strtotime('24:00:00'))){ 166 if (($new_start_time > $endTime && $new_start_time < $stateTime) && ($new_end_time > $stateTime && $new_end_time < strtotime('24:00:00'))){
171 //存在首小时免费 167 //存在首小时免费
172 - dump('5');  
173 $price += (ceil(($stateTime-$new_start_time)/3600) * $cost['cost'] + ceil(($new_end_time-$stateTime)/3600) * $interval['price']); 168 $price += (ceil(($stateTime-$new_start_time)/3600) * $cost['cost'] + ceil(($new_end_time-$stateTime)/3600) * $interval['price']);
174 if ($free==1 && $is_free==0){ 169 if ($free==1 && $is_free==0){
175 $price-=$cost['cost']; 170 $price-=$cost['cost'];
@@ -178,10 +173,8 @@ class OrderController extends HomeBaseController{ @@ -178,10 +173,8 @@ class OrderController extends HomeBaseController{
178 } 173 }
179 //在预设时间段右边并不与之重合 174 //在预设时间段右边并不与之重合
180 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'))){ 175 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'))){
181 - dump('6');  
182 $price +=(ceil(($new_end_time-$new_start_time)/3600) * $interval['price']); 176 $price +=(ceil(($new_end_time-$new_start_time)/3600) * $interval['price']);
183 } 177 }
184 - dump('什么都没有');  
185 //设备使用时间段是否跨天(跨天:开始时间在昨天,结束时间在今天) 178 //设备使用时间段是否跨天(跨天:开始时间在昨天,结束时间在今天)
186 }else{ 179 }else{
187 $YesterdayStateTime=$stateTime-86400; 180 $YesterdayStateTime=$stateTime-86400;