From 8a0c9cce6bddf90938c9cf8d71625a5e0e65ad14 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Fri, 10 Nov 2023 16:15:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E5=8F=AF=E4=BB=A5=E8=B6=85=E5=87=BA=E6=8C=81?= =?UTF-8?q?=E6=9C=89=E7=A7=AF=E5=88=86=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/user/User.php | 3 +++ 1 file changed, 3 insertions(+) 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); // 减少商户积分