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

interface

@@ -198,7 +198,8 @@ class AesController extends HomeBaseController{ @@ -198,7 +198,8 @@ class AesController extends HomeBaseController{
198 }else{ 198 }else{
199 $data=[ 199 $data=[
200 'state'=>0, 200 'state'=>0,
201 - 'message'=>'返回指令错误' 201 + 'message'=>'返回指令错误',
  202 + 'error' =>''
202 ]; 203 ];
203 $this->apiResponse(200,'success',$data); 204 $this->apiResponse(200,'success',$data);
204 } 205 }
@@ -209,7 +210,8 @@ class AesController extends HomeBaseController{ @@ -209,7 +210,8 @@ class AesController extends HomeBaseController{
209 }else{ 210 }else{
210 $data=[ 211 $data=[
211 'state'=>0, 212 'state'=>0,
212 - 'message'=>'返回指令错误' 213 + 'message'=>'返回指令错误',
  214 + 'error' =>''
213 ]; 215 ];
214 $this->apiResponse(200,'success',$data); 216 $this->apiResponse(200,'success',$data);
215 } 217 }
@@ -257,7 +259,8 @@ class AesController extends HomeBaseController{ @@ -257,7 +259,8 @@ class AesController extends HomeBaseController{
257 }else if($key[3]=='0x00'){ 259 }else if($key[3]=='0x00'){
258 $data=[ 260 $data=[
259 'state'=>0, 261 'state'=>0,
260 - 'message'=>'开锁失败' 262 + 'message'=>'开锁失败',
  263 + 'error' =>''
261 ]; 264 ];
262 $this->apiResponse(200,'success',$data); 265 $this->apiResponse(200,'success',$data);
263 } 266 }
@@ -269,7 +272,8 @@ class AesController extends HomeBaseController{ @@ -269,7 +272,8 @@ class AesController extends HomeBaseController{
269 if ($use==0){ 272 if ($use==0){
270 $data=[ 273 $data=[
271 'state'=>0, 274 'state'=>0,
272 - 'message'=>'该设备为关闭状态,不能还锁' 275 + 'message'=>'该设备为关闭状态,不能还锁',
  276 + 'error' =>''
273 ]; 277 ];
274 $this->apiResponse(200,'success',$data); 278 $this->apiResponse(200,'success',$data);
275 } 279 }
@@ -281,7 +285,8 @@ class AesController extends HomeBaseController{ @@ -281,7 +285,8 @@ class AesController extends HomeBaseController{
281 //修改数据库设备状态 285 //修改数据库设备状态
282 $data=[ 286 $data=[
283 'state'=>0, 287 'state'=>0,
284 - 'message'=>'未还床' 288 + 'message'=>'未还床',
  289 + 'error' =>''
285 ]; 290 ];
286 $this->apiResponse(200,'success',$data); 291 $this->apiResponse(200,'success',$data);
287 }else if($key[6]=='0x00'){ 292 }else if($key[6]=='0x00'){
@@ -90,7 +90,8 @@ class OrderController extends HomeBaseController{ @@ -90,7 +90,8 @@ class OrderController extends HomeBaseController{
90 Db::rollback(); 90 Db::rollback();
91 $data=[ 91 $data=[
92 'state'=>false, 92 'state'=>false,
93 - 'message'=>$exception->getMessage() 93 + 'message'=>'数据库操作失败',
  94 + 'error' =>$exception->getMessage()
94 ]; 95 ];
95 $this->apiResponse(200,'success',$data); 96 $this->apiResponse(200,'success',$data);
96 } 97 }
@@ -81,6 +81,22 @@ class UsersController extends HomeBaseController{ @@ -81,6 +81,22 @@ class UsersController extends HomeBaseController{
81 } 81 }
82 } 82 }
83 83
  84 + /**
  85 + * @title 用户交纳押金
  86 + * @description 交纳押金
  87 + * @author 董瑞恩
  88 + * @url /portal/users/getOrder
  89 + * @method GET
  90 + *
  91 + * @param name:users_id type:String require:1 default:无 other: desc:用户id
  92 + *
  93 + * @return data:下单返回值
  94 + */
  95 + public function getOrder(){
  96 + $users_id=$this->request->param('users_id');
  97 + $order=Db::name('order')->where(['users_id'=>$users_id])->select();
  98 + $this->apiResponse(200,'success',$order);
  99 + }
84 100
85 101
86 /** 102 /**