|
|
@@ -329,8 +329,8 @@ class UserExchangeServices extends BaseServices
|
|
|
}
|
|
|
if ($user['is_auth'] != 2) throw new ValidateException('请先完成实名认证');
|
|
|
if ($data['name'] != $user['real_name']) throw new ValidateException('转换用户与实名认证不符');
|
|
|
- $data['energy'] = $user['energy'];
|
|
|
- if ($data['money'] > $data['energy']) {
|
|
|
+ $data['money'] = $data['energy'];
|
|
|
+ if ($data['money'] > $user['energy']) {
|
|
|
throw new ValidateException('可转换能量值不足');
|
|
|
}
|
|
|
|