1 个管道
的构建
通过
耗费
1 秒
change appidsecritp
正在显示
2 个修改的文件
包含
10 行增加
和
7 行删除
@@ -191,7 +191,8 @@ class AesController extends HomeBaseController{ | @@ -191,7 +191,8 @@ class AesController extends HomeBaseController{ | ||
191 | * @return message:错误类型 | 191 | * @return message:错误类型 |
192 | * @return error:错误描述 | 192 | * @return error:错误描述 |
193 | */ | 193 | */ |
194 | - public function state($users_id,$name,$key,$type){ | 194 | + public function |
195 | + state($users_id,$name,$key,$type){ | ||
195 | $key=$this->ToArray($key); | 196 | $key=$this->ToArray($key); |
196 | if ($type==1){ | 197 | if ($type==1){ |
197 | //判断命令是否合法 | 198 | //判断命令是否合法 |
@@ -117,7 +117,9 @@ class OrderController extends HomeBaseController{ | @@ -117,7 +117,9 @@ class OrderController extends HomeBaseController{ | ||
117 | $cost=Db::name('cost')->where('id',1)->find(); | 117 | $cost=Db::name('cost')->where('id',1)->find(); |
118 | $interval = Db::name('interval')->where('id',1)->find(); | 118 | $interval = Db::name('interval')->where('id',1)->find(); |
119 | $is_free=Db::name('users')->where('id',$users_id)->find()['is_free']; | 119 | $is_free=Db::name('users')->where('id',$users_id)->find()['is_free']; |
120 | + //一小时免费状态 | ||
120 | $free=$cost['free']; | 121 | $free=$cost['free']; |
122 | + | ||
121 | //获取整天的价格 | 123 | //获取整天的价格 |
122 | $dayPrice=$this->getDayPrice(); | 124 | $dayPrice=$this->getDayPrice(); |
123 | 125 | ||
@@ -181,7 +183,7 @@ class OrderController extends HomeBaseController{ | @@ -181,7 +183,7 @@ class OrderController extends HomeBaseController{ | ||
181 | $YesterdayEndTime=$endTime-86400; | 183 | $YesterdayEndTime=$endTime-86400; |
182 | //昨天预设结束前使用,今天预设结束前停止 | 184 | //昨天预设结束前使用,今天预设结束前停止 |
183 | if(($new_start_time > (strtotime('00:00:00')-86400) && $new_start_time < $YesterdayEndTime) && ($new_end_time > strtotime('00:00:00') && $new_end_time < $endTime)){ | 185 | if(($new_start_time > (strtotime('00:00:00')-86400) && $new_start_time < $YesterdayEndTime) && ($new_end_time > strtotime('00:00:00') && $new_end_time < $endTime)){ |
184 | - echo 1; | 186 | + |
185 | $price+= ceil(($YesterdayEndTime-$new_start_time)/3600) * $interval['price'] | 187 | $price+= ceil(($YesterdayEndTime-$new_start_time)/3600) * $interval['price'] |
186 | +ceil(($YesterdayStateTime-$YesterdayEndTime)/3600) * $cost['cost'] | 188 | +ceil(($YesterdayStateTime-$YesterdayEndTime)/3600) * $cost['cost'] |
187 | +ceil(($new_end_time-$YesterdayStateTime)/3600) * $interval['price']; | 189 | +ceil(($new_end_time-$YesterdayStateTime)/3600) * $interval['price']; |
@@ -189,7 +191,7 @@ class OrderController extends HomeBaseController{ | @@ -189,7 +191,7 @@ class OrderController extends HomeBaseController{ | ||
189 | //昨天预设开始前使用,今天预设结束前停止 | 191 | //昨天预设开始前使用,今天预设结束前停止 |
190 | if(($new_start_time > $YesterdayEndTime && $new_start_time < $YesterdayStateTime) && ($new_end_time > strtotime('00:00:00') && $new_end_time < $endTime)){ | 192 | if(($new_start_time > $YesterdayEndTime && $new_start_time < $YesterdayStateTime) && ($new_end_time > strtotime('00:00:00') && $new_end_time < $endTime)){ |
191 | //存在首小时免费 | 193 | //存在首小时免费 |
192 | - echo 1; | 194 | + |
193 | $price+= ceil(($YesterdayStateTime-$new_start_time)/3600) * $cost['cost'] | 195 | $price+= ceil(($YesterdayStateTime-$new_start_time)/3600) * $cost['cost'] |
194 | +ceil(($new_end_time-$YesterdayStateTime)/3600) * $interval['price']; | 196 | +ceil(($new_end_time-$YesterdayStateTime)/3600) * $interval['price']; |
195 | if ($free==1 && $is_free==0){ | 197 | if ($free==1 && $is_free==0){ |
@@ -200,7 +202,7 @@ class OrderController extends HomeBaseController{ | @@ -200,7 +202,7 @@ class OrderController extends HomeBaseController{ | ||
200 | //昨天预设开始前使用,今天预设结束后停止 | 202 | //昨天预设开始前使用,今天预设结束后停止 |
201 | if(($new_start_time > $YesterdayEndTime && $new_start_time < $YesterdayStateTime) && ($new_end_time > $endTime && $new_end_time < $stateTime)){ | 203 | if(($new_start_time > $YesterdayEndTime && $new_start_time < $YesterdayStateTime) && ($new_end_time > $endTime && $new_end_time < $stateTime)){ |
202 | //存在首小时免费 | 204 | //存在首小时免费 |
203 | - echo 1; | 205 | + |
204 | $price+= ceil(($YesterdayStateTime-$new_start_time)/3600) * $cost['cost'] | 206 | $price+= ceil(($YesterdayStateTime-$new_start_time)/3600) * $cost['cost'] |
205 | +ceil(($endTime-$YesterdayStateTime)/3600) * $interval['price'] | 207 | +ceil(($endTime-$YesterdayStateTime)/3600) * $interval['price'] |
206 | +ceil(($new_end_time-$endTime)/3600) * $cost['cost']; | 208 | +ceil(($new_end_time-$endTime)/3600) * $cost['cost']; |
@@ -211,18 +213,18 @@ class OrderController extends HomeBaseController{ | @@ -211,18 +213,18 @@ class OrderController extends HomeBaseController{ | ||
211 | } | 213 | } |
212 | //昨天预设开始后使用,今天预设结束前停止 | 214 | //昨天预设开始后使用,今天预设结束前停止 |
213 | if(($new_start_time > $YesterdayStateTime && $new_start_time < strtotime('00:00:00')) && ($new_end_time > strtotime('00:00:00') && $new_end_time < $endTime)){ | 215 | if(($new_start_time > $YesterdayStateTime && $new_start_time < strtotime('00:00:00')) && ($new_end_time > strtotime('00:00:00') && $new_end_time < $endTime)){ |
214 | - echo 1; | 216 | + |
215 | $price+= ceil(($new_end_time-$new_start_time)/3600) * $interval['price']; | 217 | $price+= ceil(($new_end_time-$new_start_time)/3600) * $interval['price']; |
216 | } | 218 | } |
217 | //昨天预设开始后使用,今天预设结束后停止 | 219 | //昨天预设开始后使用,今天预设结束后停止 |
218 | if(($new_start_time > $YesterdayStateTime && $new_start_time < strtotime('00:00:00')) && ($new_end_time > $endTime && $new_end_time < $stateTime)){ | 220 | if(($new_start_time > $YesterdayStateTime && $new_start_time < strtotime('00:00:00')) && ($new_end_time > $endTime && $new_end_time < $stateTime)){ |
219 | - echo 1; | 221 | + |
220 | $price+= ceil(($endTime-$new_start_time)/3600) * $interval['price'] | 222 | $price+= ceil(($endTime-$new_start_time)/3600) * $interval['price'] |
221 | +ceil(($new_end_time-$endTime)/3600) * $cost['cost']; | 223 | +ceil(($new_end_time-$endTime)/3600) * $cost['cost']; |
222 | } | 224 | } |
223 | //昨天预设开始后使用,今天预设开始前停止 | 225 | //昨天预设开始后使用,今天预设开始前停止 |
224 | if(($new_start_time > $YesterdayStateTime && $new_start_time < strtotime('00:00:00')) && ($new_end_time > $stateTime && $new_end_time < ($new_start_time+86400))){ | 226 | if(($new_start_time > $YesterdayStateTime && $new_start_time < strtotime('00:00:00')) && ($new_end_time > $stateTime && $new_end_time < ($new_start_time+86400))){ |
225 | - echo 1; | 227 | + |
226 | $price+= ceil(($endTime-$new_start_time)/3600) * $interval['price'] | 228 | $price+= ceil(($endTime-$new_start_time)/3600) * $interval['price'] |
227 | +ceil(($stateTime-$endTime)/3600) * $cost['cost'] | 229 | +ceil(($stateTime-$endTime)/3600) * $cost['cost'] |
228 | +ceil(($new_end_time-$stateTime)/3600) * $interval['price']; | 230 | +ceil(($new_end_time-$stateTime)/3600) * $interval['price']; |
-
请 注册 或 登录 后发表评论