...
|
...
|
@@ -305,6 +305,13 @@ class UsersController extends HomeBaseController{ |
|
|
public function refundDeposit(){
|
|
|
$users_id=$this->request->param('users_id');
|
|
|
$users=Db::name('users')->where('id',$users_id)->find();
|
|
|
if ($users['is_deposit']==0){
|
|
|
$this->apiResponse(302,'用户未缴纳押金');
|
|
|
}
|
|
|
$order=Db::name('order')->where(['users_id'=>$users_id,'state'=>['in',[1,2]]])->find();
|
|
|
if (!empty($order)){
|
|
|
$this->apiResponse(303,'用户还有未支付订单');
|
|
|
}
|
|
|
$orderNo=$users['deposit_order_no'];//需要退款的订单
|
|
|
$price=$users['deposit'];
|
|
|
Db::startTrans();
|
...
|
...
|
@@ -322,7 +329,7 @@ class UsersController extends HomeBaseController{ |
|
|
Db::commit();
|
|
|
}else{
|
|
|
Db::rollback();
|
|
|
$this->apiResponse(301,'error:'.$result);
|
|
|
$this->apiResponse(302,'error:'.$result);
|
|
|
}
|
|
|
$this->apiResponse(200,'success');
|
|
|
}
|
...
|
...
|
|