6
0
Fork 0
panliang 2022-08-04 10:31:56 +08:00
parent 8ae61488ed
commit 08979d4187
1 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,7 @@ use App\Models\{User, Order, SalesValueLog, Agent, OrderProfit};
use App\Services\Payment\WxpayService;
use App\Enums\SocialiteType;
use App\Exceptions\BizException;
use App\Exceptions\WeChatPayException;
/**
* 分销模块
@ -164,6 +165,9 @@ class DistributeService
{
$user = $profit->user;
$openid = $user->socialites()->where('socialite_type', SocialiteType::WechatMiniProgram->value)->value('socialite_id');
if (!$openid) {
throw new WeChatPayException('没有 openid');
}
$result = (new WxpayService())->transfer([
'partner_trade_no' => $profit->pay_no,
'openid' => $openid,