作者 董瑞恩
1 个管道 的构建 通过 耗费 1 秒

interface

... ... @@ -53,7 +53,7 @@ class AdminFaultController extends AdminBaseController{
}else{
$time=ceil(($fault['create_time']-$order['start_time'])/3600);
$getPrice=new OrderController();
$price=$getPrice->getPrice($order['start_time'],$fault['create_time']);
$price=$getPrice->getPrice($fault['users_id'],$order['start_time'],$fault['create_time']);
$data=[
'end_time'=>$fault['create_time'],
'time'=>$time,
... ...
... ... @@ -113,7 +113,7 @@ class OrderController extends HomeBaseController{
}
public function getPrice($users_id,$start_time=1543298302,$end_time=1543303733){
public function getPrice($users_id,$start_time,$end_time){
$cost=Db::name('cost')->where('id',1)->find();
$interval = Db::name('interval')->where('id',1)->find();
$is_free=Db::name('users')->where('id',$users_id)->find()['is_free'];
... ...
... ... @@ -195,7 +195,7 @@ class UsersController extends HomeBaseController{
$order['end_time']=time();
$order['time']=ceil(($order['end_time']-$order['start_time'])/3600);
$price=new OrderController();
$order['price']=$price->getPrice($order['start_time'],$order['end_time']);
$order['price']=$price->getPrice($users_id,$order['start_time'],$order['end_time']);
$this->apiResponse(200,'success',$order);
}
... ...