diff --git a/app/controller/api/user/User.php b/app/controller/api/user/User.php index 6ee0253..367d71f 100644 --- a/app/controller/api/user/User.php +++ b/app/controller/api/user/User.php @@ -477,6 +477,9 @@ class User extends BaseController $user = app()->make(UserRepository::class)->get($uid); $integralMake = app()->make(\app\common\repositories\user\IntegralRepository::class); $bills = []; + // 判断:是否允许转换 + $holdIntegral = $integralMake->getMerIntegral((int)$uid,(int)$merId); + if($holdIntegral < $convertIntegral) throw new Exception('转换失败,持有积分不足!'); // 计算转换后的积分 应得平台积分 $convertAfterIntegral = (float)sprintf("%.2f",$convertIntegral * $mer_integral_platform_rate); // 减少商户积分