...
|
...
|
@@ -73,9 +73,9 @@ class OrderController extends HomeBaseController{ |
|
|
// */
|
|
|
public function order($users_id,$name){
|
|
|
$order= Db::name('order')->where(['users_id'=>$users_id,'state'=>1])->find();
|
|
|
|
|
|
$hospital=Db::name('equipment')->where('name',$order['eq_name'])->find()['hospital'];
|
|
|
$end_time=time();
|
|
|
$price=$this->getPrice($users_id,$order['start_time'],$end_time);
|
|
|
$price=$this->getPrice($users_id,$order['start_time'],$end_time,$hospital);
|
|
|
$time=ceil(($end_time-$order['start_time'])/3600);
|
|
|
$data=[
|
|
|
'end_time'=>$end_time,
|
...
|
...
|
@@ -458,7 +458,7 @@ class OrderController extends HomeBaseController{ |
|
|
|
|
|
|
|
|
|
|
|
public function getPrice($users_id,$start_time,$end_time){
|
|
|
public function getPrice($users_id,$start_time,$end_time,$hospital){
|
|
|
/*先获取跨越天数*/
|
|
|
|
|
|
|
...
|
...
|
@@ -468,8 +468,8 @@ class OrderController extends HomeBaseController{ |
|
|
if ($spend['min']!=0||$spend['sec']!=0){
|
|
|
$spend['hour']++;
|
|
|
}
|
|
|
$interval = Db::name('interval')->where('id',1)->find();
|
|
|
$cost=Db::name('cost')->where('id',1)->find();
|
|
|
$interval = Db::name('interval')->where('hospital',$hospital)->find();
|
|
|
$cost=Db::name('cost')->where('hospital',$hospital)->find();
|
|
|
$is_free=Db::name('users')->where('id',$users_id)->find()['is_free'];
|
|
|
$price=0;
|
|
|
$time=$start_time;
|
...
|
...
|
|