|
|
@@ -58,19 +58,18 @@ class CapitalLogService extends BaseService
|
|
|
$userId = isset($data['user_id'])? $data['user_id'] : 0;
|
|
|
$money = isset($data['num'])? floatval($data['num']) : 0;
|
|
|
if($userId<=0){
|
|
|
- returnJson('承兑商用户参数错误,请刷新后重试');
|
|
|
+ return returnJson('承兑商用户参数错误,请刷新后重试');
|
|
|
}
|
|
|
|
|
|
if($money<=0){
|
|
|
- returnJson('请输入正确的金额');
|
|
|
+ return returnJson('请输入正确的金额');
|
|
|
}
|
|
|
|
|
|
$info = $this->userModel->getInfo($id);
|
|
|
if(empty($info) || empty($info['user_id'])){
|
|
|
- returnJson('用户不存在');
|
|
|
+ return returnJson('用户不存在');
|
|
|
}
|
|
|
|
|
|
- var_dump($info);
|
|
|
if($info['user_type'] != 2){
|
|
|
returnJson('用户类型错误,非承兑商用户');
|
|
|
}
|
|
|
@@ -78,7 +77,7 @@ class CapitalLogService extends BaseService
|
|
|
$changeType = isset($data['change_type'])? $data['change_type'] : 0;
|
|
|
$changeType = $changeType==1? $changeType : 2;
|
|
|
if($changeType==2 && $info['bond'] < $money){
|
|
|
- returnJson('退保金额超出账户保证金余额:'.$info['bond']);
|
|
|
+ return returnJson('退保金额超出账户保证金余额:'.$info['bond']);
|
|
|
}
|
|
|
|
|
|
$data = [
|
|
|
@@ -97,7 +96,7 @@ class CapitalLogService extends BaseService
|
|
|
$success = isset($result['success'])? $result['success'] : false;
|
|
|
if($success){
|
|
|
if($changeType == 1){
|
|
|
- $this->userModel->where(['id'=> $id])->imcrement('bond', $money);
|
|
|
+ $this->userModel->where(['id'=> $id])->increment('bond', $money);
|
|
|
}else{
|
|
|
$this->userModel->where(['id'=> $id])->decrement('bond', $money);
|
|
|
}
|