修改:转换积分可以超出持有积分的问题
This commit is contained in:
parent
9925ef1918
commit
8a0c9cce6b
|
|
@ -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);
|
||||
// 减少商户积分
|
||||
|
|
|
|||
Loading…
Reference in New Issue