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