作者 潘浩文
1 个管道 的构建 通过 耗费 0 秒

XIAOPAN

... ... @@ -73,7 +73,7 @@ class OrderController extends HomeBaseController{
// */
public function order($users_id,$name){
$order= Db::name('order')->where(['users_id'=>$users_id,'state'=>1])->find();
$this->apiResponse(200,'success',$order);
$end_time=time();
$price=$this->getPrice($users_id,$order['start_time'],$end_time);
$time=ceil(($end_time-$order['start_time'])/3600);
... ... @@ -83,6 +83,7 @@ class OrderController extends HomeBaseController{
'price' => $price,
'state' => 2
];
$this->apiResponse(200,'success',$order);
try{
Db::startTrans();
Db::name('users')->where('id',$users_id)->update(['is_use'=>0]);
... ...