正在显示
1 个修改的文件
包含
12 行增加
和
2 行删除
@@ -123,7 +123,7 @@ class OrderController extends HomeBaseController{ | @@ -123,7 +123,7 @@ class OrderController extends HomeBaseController{ | ||
123 | 123 | ||
124 | //用了多少天 | 124 | //用了多少天 |
125 | $day=floor(($end_time-$start_time)/86400); | 125 | $day=floor(($end_time-$start_time)/86400); |
126 | - $price=$day*$dayPrice; | 126 | + $dayPrice=$day*$dayPrice; |
127 | //去掉整天的金额 | 127 | //去掉整天的金额 |
128 | $new_start_time=$start_time+$day*86400;//时间戳 | 128 | $new_start_time=$start_time+$day*86400;//时间戳 |
129 | $new_end_time= $end_time;//时间戳 | 129 | $new_end_time= $end_time;//时间戳 |
@@ -133,6 +133,7 @@ class OrderController extends HomeBaseController{ | @@ -133,6 +133,7 @@ class OrderController extends HomeBaseController{ | ||
133 | $stateTime=strtotime($interval['start_time']); | 133 | $stateTime=strtotime($interval['start_time']); |
134 | $endTime=strtotime($interval['end_time']); | 134 | $endTime=strtotime($interval['end_time']); |
135 | //判断预设时间段是否跨天 | 135 | //判断预设时间段是否跨天 |
136 | + $price=0; | ||
136 | if ($endTime < $stateTime){ | 137 | if ($endTime < $stateTime){ |
137 | //设备使用时间段是否跨天(不跨天) | 138 | //设备使用时间段是否跨天(不跨天) |
138 | if ($hours_end_time > $hours_start_time){ | 139 | if ($hours_end_time > $hours_start_time){ |
@@ -219,7 +220,12 @@ class OrderController extends HomeBaseController{ | @@ -219,7 +220,12 @@ class OrderController extends HomeBaseController{ | ||
219 | } | 220 | } |
220 | } | 221 | } |
221 | } | 222 | } |
222 | - return $price; | 223 | + |
224 | + if ($price > $cost['ceiling']){ | ||
225 | + $price = $cost['ceiling']; | ||
226 | + } | ||
227 | + $numPrice = $dayPrice+$price; | ||
228 | + return $numPrice; | ||
223 | } | 229 | } |
224 | 230 | ||
225 | //获取整天的价格 | 231 | //获取整天的价格 |
@@ -235,6 +241,10 @@ class OrderController extends HomeBaseController{ | @@ -235,6 +241,10 @@ class OrderController extends HomeBaseController{ | ||
235 | }else{ | 241 | }else{ |
236 | $price=($time * $interval['price']) + ((24-$time) * $cost['cost']); | 242 | $price=($time * $interval['price']) + ((24-$time) * $cost['cost']); |
237 | } | 243 | } |
244 | + | ||
245 | + if ($price > $cost['ceiling']){ | ||
246 | + $price = $cost['ceiling']; | ||
247 | + } | ||
238 | return $price; | 248 | return $price; |
239 | } | 249 | } |
240 | 250 |
-
请 注册 或 登录 后发表评论