diff --git a/app/Services/DistributeService.php b/app/Services/DistributeService.php index 489cc2e4..bf328cb6 100644 --- a/app/Services/DistributeService.php +++ b/app/Services/DistributeService.php @@ -106,6 +106,9 @@ class DistributeService continue; } $money = floor($sales_value * $agent->ratio) / 100 - $money_sum; + if ($money <= 0) { + continue; + } array_unshift($profit_list, [ 'from_user_id' => $user->id, 'user_id' => $item->id, @@ -165,6 +168,9 @@ class DistributeService { $user = $profit->user; $openid = $user->socialites()->where('socialite_type', SocialiteType::WechatMiniProgram->value)->value('socialite_id'); + if ($profit->money <= 0) { + throw new WeChatPayException('返利金额必须大于0'); + } if (!$openid) { throw new WeChatPayException('没有 openid'); }