distribute
parent
dd63b669a1
commit
a70080281d
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue