正在显示
1 个修改的文件
包含
8 行增加
和
1 行删除
@@ -305,6 +305,13 @@ class UsersController extends HomeBaseController{ | @@ -305,6 +305,13 @@ class UsersController extends HomeBaseController{ | ||
305 | public function refundDeposit(){ | 305 | public function refundDeposit(){ |
306 | $users_id=$this->request->param('users_id'); | 306 | $users_id=$this->request->param('users_id'); |
307 | $users=Db::name('users')->where('id',$users_id)->find(); | 307 | $users=Db::name('users')->where('id',$users_id)->find(); |
308 | + if ($users['is_deposit']==0){ | ||
309 | + $this->apiResponse(302,'用户未缴纳押金'); | ||
310 | + } | ||
311 | + $order=Db::name('order')->where(['users_id'=>$users_id,'state'=>['in',[1,2]]])->find(); | ||
312 | + if (!empty($order)){ | ||
313 | + $this->apiResponse(303,'用户还有未支付订单'); | ||
314 | + } | ||
308 | $orderNo=$users['deposit_order_no'];//需要退款的订单 | 315 | $orderNo=$users['deposit_order_no'];//需要退款的订单 |
309 | $price=$users['deposit']; | 316 | $price=$users['deposit']; |
310 | Db::startTrans(); | 317 | Db::startTrans(); |
@@ -322,7 +329,7 @@ class UsersController extends HomeBaseController{ | @@ -322,7 +329,7 @@ class UsersController extends HomeBaseController{ | ||
322 | Db::commit(); | 329 | Db::commit(); |
323 | }else{ | 330 | }else{ |
324 | Db::rollback(); | 331 | Db::rollback(); |
325 | - $this->apiResponse(301,'error:'.$result); | 332 | + $this->apiResponse(302,'error:'.$result); |
326 | } | 333 | } |
327 | $this->apiResponse(200,'success'); | 334 | $this->apiResponse(200,'success'); |
328 | } | 335 | } |
-
请 注册 或 登录 后发表评论