正在显示
1 个修改的文件
包含
14 行增加
和
0 行删除
@@ -139,19 +139,25 @@ class OrderController extends HomeBaseController{ | @@ -139,19 +139,25 @@ class OrderController extends HomeBaseController{ | ||
139 | if ($hours_end_time > $hours_start_time){ | 139 | if ($hours_end_time > $hours_start_time){ |
140 | //在预设时间段左边并不与之重合 | 140 | //在预设时间段左边并不与之重合 |
141 | if (($new_start_time > strtotime('00:00:00') && $new_start_time < $endTime) && ($new_end_time > $new_start_time && $new_end_time < $endTime)){ | 141 | if (($new_start_time > strtotime('00:00:00') && $new_start_time < $endTime) && ($new_end_time > $new_start_time && $new_end_time < $endTime)){ |
142 | + echo 1; | ||
142 | $price +=(ceil(($new_end_time-$new_start_time)/3600) * $interval['price']); | 143 | $price +=(ceil(($new_end_time-$new_start_time)/3600) * $interval['price']); |
143 | } | 144 | } |
144 | //与预设时间段的尾部重合 | 145 | //与预设时间段的尾部重合 |
145 | if (($new_start_time > strtotime('00:00:00') && $new_start_time < $endTime) && ($new_end_time > $endTime && $new_end_time < $stateTime)){ | 146 | if (($new_start_time > strtotime('00:00:00') && $new_start_time < $endTime) && ($new_end_time > $endTime && $new_end_time < $stateTime)){ |
147 | + echo 2; | ||
146 | $price +=(ceil(($endTime-$new_start_time)/3600) * $interval['price'] + ceil(($new_end_time-$endTime)/3600) * $cost['cost']); | 148 | $price +=(ceil(($endTime-$new_start_time)/3600) * $interval['price'] + ceil(($new_end_time-$endTime)/3600) * $cost['cost']); |
147 | } | 149 | } |
148 | //与预设时间段的头尾都重合 | 150 | //与预设时间段的头尾都重合 |
149 | if (($new_start_time > strtotime('00:00:00') && $new_start_time < $endTime) && $new_end_time > $stateTime){ | 151 | if (($new_start_time > strtotime('00:00:00') && $new_start_time < $endTime) && $new_end_time > $stateTime){ |
152 | + echo 3; | ||
150 | $price +=(ceil(($endTime-$new_start_time)/3600) * $interval['price'] + ceil(($new_end_time-$stateTime)/3600) * $interval['price'] + ceil(($stateTime-$endTime)/3600) * $cost['cost']); | 153 | $price +=(ceil(($endTime-$new_start_time)/3600) * $interval['price'] + ceil(($new_end_time-$stateTime)/3600) * $interval['price'] + ceil(($stateTime-$endTime)/3600) * $cost['cost']); |
151 | } | 154 | } |
152 | //不与预设时间段重合 | 155 | //不与预设时间段重合 |
153 | if (($new_start_time > $endTime && $new_start_time < $stateTime) && ($new_end_time < $new_start_time && $new_end_time < $stateTime)){ | 156 | if (($new_start_time > $endTime && $new_start_time < $stateTime) && ($new_end_time < $new_start_time && $new_end_time < $stateTime)){ |
154 | //存在首小时免费 | 157 | //存在首小时免费 |
158 | + echo 4; | ||
159 | + echo $new_end_time; | ||
160 | + echo $new_start_time; | ||
155 | $price +=(ceil(($new_end_time-$new_start_time)/3600) * $cost['cost']); | 161 | $price +=(ceil(($new_end_time-$new_start_time)/3600) * $cost['cost']); |
156 | if ($free==1 && $is_free==0){ | 162 | if ($free==1 && $is_free==0){ |
157 | $price-=$cost['cost']; | 163 | $price-=$cost['cost']; |
@@ -161,6 +167,7 @@ class OrderController extends HomeBaseController{ | @@ -161,6 +167,7 @@ class OrderController extends HomeBaseController{ | ||
161 | //与预设时间段的头部重合 | 167 | //与预设时间段的头部重合 |
162 | if (($new_start_time > $endTime && $new_start_time < $stateTime) && ($new_end_time > $stateTime && $new_end_time < strtotime('24:00:00'))){ | 168 | if (($new_start_time > $endTime && $new_start_time < $stateTime) && ($new_end_time > $stateTime && $new_end_time < strtotime('24:00:00'))){ |
163 | //存在首小时免费 | 169 | //存在首小时免费 |
170 | + echo 5; | ||
164 | $price += (ceil(($stateTime-$new_start_time)/3600) * $cost['cost'] + ceil(($new_end_time-$stateTime)/3600) * $interval['price']); | 171 | $price += (ceil(($stateTime-$new_start_time)/3600) * $cost['cost'] + ceil(($new_end_time-$stateTime)/3600) * $interval['price']); |
165 | if ($free==1 && $is_free==0){ | 172 | if ($free==1 && $is_free==0){ |
166 | $price-=$cost['cost']; | 173 | $price-=$cost['cost']; |
@@ -169,6 +176,7 @@ class OrderController extends HomeBaseController{ | @@ -169,6 +176,7 @@ class OrderController extends HomeBaseController{ | ||
169 | } | 176 | } |
170 | //在预设时间段右边并不与之重合 | 177 | //在预设时间段右边并不与之重合 |
171 | 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'))){ | 178 | 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'))){ |
179 | + echo 6; | ||
172 | $price +=(ceil(($new_end_time-$new_start_time)/3600) * $interval['price']); | 180 | $price +=(ceil(($new_end_time-$new_start_time)/3600) * $interval['price']); |
173 | } | 181 | } |
174 | 182 | ||
@@ -178,6 +186,7 @@ class OrderController extends HomeBaseController{ | @@ -178,6 +186,7 @@ class OrderController extends HomeBaseController{ | ||
178 | $YesterdayEndTime=$endTime-86400; | 186 | $YesterdayEndTime=$endTime-86400; |
179 | //昨天预设结束前使用,今天预设结束前停止 | 187 | //昨天预设结束前使用,今天预设结束前停止 |
180 | if(($new_start_time > (strtotime('00:00:00')-86400) && $new_start_time < $YesterdayEndTime) && ($new_end_time > strtotime('00:00:00') && $new_end_time < $endTime)){ | 188 | if(($new_start_time > (strtotime('00:00:00')-86400) && $new_start_time < $YesterdayEndTime) && ($new_end_time > strtotime('00:00:00') && $new_end_time < $endTime)){ |
189 | + echo 1; | ||
181 | $price+= ceil(($YesterdayEndTime-$new_start_time)/3600) * $interval['price'] | 190 | $price+= ceil(($YesterdayEndTime-$new_start_time)/3600) * $interval['price'] |
182 | +ceil(($YesterdayStateTime-$YesterdayEndTime)/3600) * $cost['cost'] | 191 | +ceil(($YesterdayStateTime-$YesterdayEndTime)/3600) * $cost['cost'] |
183 | +ceil(($new_end_time-$YesterdayStateTime)/3600) * $interval['price']; | 192 | +ceil(($new_end_time-$YesterdayStateTime)/3600) * $interval['price']; |
@@ -185,6 +194,7 @@ class OrderController extends HomeBaseController{ | @@ -185,6 +194,7 @@ class OrderController extends HomeBaseController{ | ||
185 | //昨天预设开始前使用,今天预设结束前停止 | 194 | //昨天预设开始前使用,今天预设结束前停止 |
186 | if(($new_start_time > $YesterdayEndTime && $new_start_time < $YesterdayStateTime) && ($new_end_time > strtotime('00:00:00') && $new_end_time < $endTime)){ | 195 | if(($new_start_time > $YesterdayEndTime && $new_start_time < $YesterdayStateTime) && ($new_end_time > strtotime('00:00:00') && $new_end_time < $endTime)){ |
187 | //存在首小时免费 | 196 | //存在首小时免费 |
197 | + echo 1; | ||
188 | $price+= ceil(($YesterdayStateTime-$new_start_time)/3600) * $cost['cost'] | 198 | $price+= ceil(($YesterdayStateTime-$new_start_time)/3600) * $cost['cost'] |
189 | +ceil(($new_end_time-$YesterdayStateTime)/3600) * $interval['price']; | 199 | +ceil(($new_end_time-$YesterdayStateTime)/3600) * $interval['price']; |
190 | if ($free==1 && $is_free==0){ | 200 | if ($free==1 && $is_free==0){ |
@@ -195,6 +205,7 @@ class OrderController extends HomeBaseController{ | @@ -195,6 +205,7 @@ class OrderController extends HomeBaseController{ | ||
195 | //昨天预设开始前使用,今天预设结束后停止 | 205 | //昨天预设开始前使用,今天预设结束后停止 |
196 | if(($new_start_time > $YesterdayEndTime && $new_start_time < $YesterdayStateTime) && ($new_end_time > $endTime && $new_end_time < $stateTime)){ | 206 | if(($new_start_time > $YesterdayEndTime && $new_start_time < $YesterdayStateTime) && ($new_end_time > $endTime && $new_end_time < $stateTime)){ |
197 | //存在首小时免费 | 207 | //存在首小时免费 |
208 | + echo 1; | ||
198 | $price+= ceil(($YesterdayStateTime-$new_start_time)/3600) * $cost['cost'] | 209 | $price+= ceil(($YesterdayStateTime-$new_start_time)/3600) * $cost['cost'] |
199 | +ceil(($endTime-$YesterdayStateTime)/3600) * $interval['price'] | 210 | +ceil(($endTime-$YesterdayStateTime)/3600) * $interval['price'] |
200 | +ceil(($new_end_time-$endTime)/3600) * $cost['cost']; | 211 | +ceil(($new_end_time-$endTime)/3600) * $cost['cost']; |
@@ -205,15 +216,18 @@ class OrderController extends HomeBaseController{ | @@ -205,15 +216,18 @@ class OrderController extends HomeBaseController{ | ||
205 | } | 216 | } |
206 | //昨天预设开始后使用,今天预设结束前停止 | 217 | //昨天预设开始后使用,今天预设结束前停止 |
207 | if(($new_start_time > $YesterdayStateTime && $new_start_time < strtotime('00:00:00')) && ($new_end_time > strtotime('00:00:00') && $new_end_time < $endTime)){ | 218 | if(($new_start_time > $YesterdayStateTime && $new_start_time < strtotime('00:00:00')) && ($new_end_time > strtotime('00:00:00') && $new_end_time < $endTime)){ |
219 | + echo 1; | ||
208 | $price+= ceil(($new_end_time-$new_start_time)/3600) * $interval['price']; | 220 | $price+= ceil(($new_end_time-$new_start_time)/3600) * $interval['price']; |
209 | } | 221 | } |
210 | //昨天预设开始后使用,今天预设结束后停止 | 222 | //昨天预设开始后使用,今天预设结束后停止 |
211 | if(($new_start_time > $YesterdayStateTime && $new_start_time < strtotime('00:00:00')) && ($new_end_time > $endTime && $new_end_time < $stateTime)){ | 223 | if(($new_start_time > $YesterdayStateTime && $new_start_time < strtotime('00:00:00')) && ($new_end_time > $endTime && $new_end_time < $stateTime)){ |
224 | + echo 1; | ||
212 | $price+= ceil(($endTime-$new_start_time)/3600) * $interval['price'] | 225 | $price+= ceil(($endTime-$new_start_time)/3600) * $interval['price'] |
213 | +ceil(($new_end_time-$endTime)/3600) * $cost['cost']; | 226 | +ceil(($new_end_time-$endTime)/3600) * $cost['cost']; |
214 | } | 227 | } |
215 | //昨天预设开始后使用,今天预设开始前停止 | 228 | //昨天预设开始后使用,今天预设开始前停止 |
216 | if(($new_start_time > $YesterdayStateTime && $new_start_time < strtotime('00:00:00')) && ($new_end_time > $stateTime && $new_end_time < ($new_start_time+86400))){ | 229 | if(($new_start_time > $YesterdayStateTime && $new_start_time < strtotime('00:00:00')) && ($new_end_time > $stateTime && $new_end_time < ($new_start_time+86400))){ |
230 | + echo 1; | ||
217 | $price+= ceil(($endTime-$new_start_time)/3600) * $interval['price'] | 231 | $price+= ceil(($endTime-$new_start_time)/3600) * $interval['price'] |
218 | +ceil(($stateTime-$endTime)/3600) * $cost['cost'] | 232 | +ceil(($stateTime-$endTime)/3600) * $cost['cost'] |
219 | +ceil(($new_end_time-$stateTime)/3600) * $interval['price']; | 233 | +ceil(($new_end_time-$stateTime)/3600) * $interval['price']; |
-
请 注册 或 登录 后发表评论