6
0
Fork 0

distribute

base
panliang 2022-08-04 11:20:06 +08:00
parent dd63b669a1
commit a70080281d
1 changed files with 6 additions and 0 deletions

View File

@ -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');
}