正在显示
1 个修改的文件
包含
26 行增加
和
14 行删除
@@ -114,7 +114,7 @@ class OrderController extends HomeBaseController{ | @@ -114,7 +114,7 @@ class OrderController extends HomeBaseController{ | ||
114 | } | 114 | } |
115 | 115 | ||
116 | 116 | ||
117 | - public function getPrice($users_id,$start_time,$end_time){ | 117 | + public function getPriceDRN($users_id,$start_time,$end_time){ |
118 | $cost=Db::name('cost')->where('id',1)->find(); | 118 | $cost=Db::name('cost')->where('id',1)->find(); |
119 | $interval = Db::name('interval')->where('id',1)->find(); | 119 | $interval = Db::name('interval')->where('id',1)->find(); |
120 | $is_free=Db::name('users')->where('id',$users_id)->find()['is_free']; | 120 | $is_free=Db::name('users')->where('id',$users_id)->find()['is_free']; |
@@ -256,7 +256,7 @@ class OrderController extends HomeBaseController{ | @@ -256,7 +256,7 @@ class OrderController extends HomeBaseController{ | ||
256 | * @throws \think\exception\DbException | 256 | * @throws \think\exception\DbException |
257 | */ | 257 | */ |
258 | 258 | ||
259 | - public function onlyGetPrice($users_id,$start_time,$end_time){ | 259 | + public function onlyGetPriceDRN($users_id,$start_time,$end_time){ |
260 | $cost=Db::name('cost')->where('id',1)->find(); | 260 | $cost=Db::name('cost')->where('id',1)->find(); |
261 | $interval = Db::name('interval')->where('id',1)->find(); | 261 | $interval = Db::name('interval')->where('id',1)->find(); |
262 | $is_free=Db::name('users')->where('id',$users_id)->find()['is_free']; | 262 | $is_free=Db::name('users')->where('id',$users_id)->find()['is_free']; |
@@ -404,6 +404,7 @@ class OrderController extends HomeBaseController{ | @@ -404,6 +404,7 @@ class OrderController extends HomeBaseController{ | ||
404 | return $price; | 404 | return $price; |
405 | } | 405 | } |
406 | /** | 406 | /** |
407 | + * 宋国杰 | ||
407 | * @title 计算价格 | 408 | * @title 计算价格 |
408 | * @description 微信统一下单 | 409 | * @description 微信统一下单 |
409 | * @author 董瑞恩 | 410 | * @author 董瑞恩 |
@@ -415,12 +416,12 @@ class OrderController extends HomeBaseController{ | @@ -415,12 +416,12 @@ class OrderController extends HomeBaseController{ | ||
415 | * | 416 | * |
416 | * @return data:返回用于调用支付的参数 | 417 | * @return data:返回用于调用支付的参数 |
417 | */ | 418 | */ |
418 | - public function getPriceSGJ(){ | 419 | + public function getPrice($users_id,$start_time,$end_time){ |
419 | /*先获取跨越天数*/ | 420 | /*先获取跨越天数*/ |
420 | - $users_id='11'; | ||
421 | - $data=input(); | ||
422 | - $start_time=$data['start_time']??'1545084020'; | ||
423 | - $end_time=$data['end_time']??time(); | 421 | + |
422 | + | ||
423 | +// $start_time=$data['start_time']??'1545084020'; | ||
424 | +// $end_time=$data['end_time']??time(); | ||
424 | $spend=$this->timediff($start_time,$end_time); | 425 | $spend=$this->timediff($start_time,$end_time); |
425 | if ($spend['min']!=0||$spend['sex']!=0){ | 426 | if ($spend['min']!=0||$spend['sex']!=0){ |
426 | $spend['hour']++; | 427 | $spend['hour']++; |
@@ -451,12 +452,22 @@ class OrderController extends HomeBaseController{ | @@ -451,12 +452,22 @@ class OrderController extends HomeBaseController{ | ||
451 | return $allPirce; | 452 | return $allPirce; |
452 | } | 453 | } |
453 | 454 | ||
454 | - public function getOnlyPriceSGJ(){ | 455 | + /** |
456 | + * 宋国杰 | ||
457 | + * @param $users_id | ||
458 | + * @param $start_time | ||
459 | + * @param $end_time | ||
460 | + * @return float|int|mixed | ||
461 | + * @throws \think\db\exception\DataNotFoundException | ||
462 | + * @throws \think\db\exception\ModelNotFoundException | ||
463 | + * @throws \think\exception\DbException | ||
464 | + */ | ||
465 | + public function onlyGetPrice($users_id,$start_time,$end_time){ | ||
455 | /*先获取跨越天数*/ | 466 | /*先获取跨越天数*/ |
456 | - $users_id='11'; | ||
457 | - $data=input(); | ||
458 | - $start_time=$data['start_time']??'1545084020'; | ||
459 | - $end_time=$data['end_time']??time(); | 467 | +// $users_id='11'; |
468 | +// $data=input(); | ||
469 | +// $start_time=$data['start_time']??'1545084020'; | ||
470 | +// $end_time=$data['end_time']??time(); | ||
460 | $spend=$this->timediff($start_time,$end_time); | 471 | $spend=$this->timediff($start_time,$end_time); |
461 | if ($spend['min']!=0||$spend['sex']!=0){ | 472 | if ($spend['min']!=0||$spend['sex']!=0){ |
462 | $spend['hour']++; | 473 | $spend['hour']++; |
@@ -471,14 +482,13 @@ class OrderController extends HomeBaseController{ | @@ -471,14 +482,13 @@ class OrderController extends HomeBaseController{ | ||
471 | $time=$time+3600; | 482 | $time=$time+3600; |
472 | } | 483 | } |
473 | 484 | ||
474 | - | ||
475 | if ($price>$cost['ceiling']){ | 485 | if ($price>$cost['ceiling']){ |
476 | $price=$cost['ceiling']; | 486 | $price=$cost['ceiling']; |
477 | $free=0; | 487 | $free=0; |
478 | }else{ | 488 | }else{ |
479 | if ($cost['free']==1 && $is_free==0){ | 489 | if ($cost['free']==1 && $is_free==0){ |
480 | $free=$this->getPriceByTime($start_time,$interval['end_time'],$interval['start_time'],$interval['price'],$cost['cost']); | 490 | $free=$this->getPriceByTime($start_time,$interval['end_time'],$interval['start_time'],$interval['price'],$cost['cost']); |
481 | - Db::name('users')->where('id',$users_id)->update(['is_free'=>1]); | 491 | +// Db::name('users')->where('id',$users_id)->update(['is_free'=>1]); |
482 | }else{ | 492 | }else{ |
483 | $free=0; | 493 | $free=0; |
484 | } | 494 | } |
@@ -488,6 +498,8 @@ class OrderController extends HomeBaseController{ | @@ -488,6 +498,8 @@ class OrderController extends HomeBaseController{ | ||
488 | } | 498 | } |
489 | 499 | ||
490 | 500 | ||
501 | + | ||
502 | + | ||
491 | public function getPriceBytime($time,$first_time,$second_time,$cost1,$cost2){ | 503 | public function getPriceBytime($time,$first_time,$second_time,$cost1,$cost2){ |
492 | $first_time=strtotime($first_time); | 504 | $first_time=strtotime($first_time); |
493 | $second_time=strtotime($second_time); | 505 | $second_time=strtotime($second_time); |
-
请 注册 或 登录 后发表评论