master
wangxinglong 2022-03-30 16:11:25 +08:00
parent 52c7b2e2b5
commit 48c3e9958b
1 changed files with 5 additions and 6 deletions

View File

@ -395,7 +395,7 @@ class Coupon extends Base
$account = AccountRepository::getInstance()->findById($accountId, [], function ($q) { $account = AccountRepository::getInstance()->findById($accountId, [], function ($q) {
return $q->with(['business', 'parent']); return $q->with(['business', 'parent']);
}); });
$time = time(); $time = time();
if(empty($account)){ if(empty($account)){
return $this->json(6001,"无效的用户"); return $this->json(6001,"无效的用户");
} }
@ -552,29 +552,28 @@ class Coupon extends Base
$distributionRedpackUser = Account::findOne([["user_code","=",$coupon->distribution_user_code]]); $distributionRedpackUser = Account::findOne([["user_code","=",$coupon->distribution_user_code]]);
//如果没有分销人 就全是平台 和分销人的 //如果没有分销人 就全是平台 和分销人的
if(empty($distributionRedpackUser)){ if(empty($distributionRedpackUser)){
$confirmAdminMoney = $disAdminMoney+$disDistributionMoney; $confirmAdminMoney = $disAdminMoney + $disDistributionMoney;
$confirmDistributionMoney = 0; $confirmDistributionMoney = 0;
$confirmDistributedMoney = $disDistributedMoney; $confirmDistributedMoney = $disDistributedMoney;
$confirmAgencyMoney = 0; $confirmAgencyMoney = $disAgencyMoney;
}else{//存在分销人 就走分销人 }else{//存在分销人 就走分销人
$confirmAdminMoney = $disAdminMoney; $confirmAdminMoney = $disAdminMoney;
$confirmDistributionMoney = $disDistributionMoney; $confirmDistributionMoney = $disDistributionMoney;
$confirmDistributedMoney = $disDistributedMoney; $confirmDistributedMoney = $disDistributedMoney;
$confirmAgencyMoney = 0; $confirmAgencyMoney = $disAgencyMoney;
} }
}else{ }else{
$confirmAdminMoney = $adminMoney; $confirmAdminMoney = $adminMoney;
$confirmDistributionMoney = 0; $confirmDistributionMoney = 0;
$confirmDistributedMoney = $consumerMoney; $confirmDistributedMoney = $consumerMoney;
$confirmAgencyMoney = $adminMoney; $confirmAgencyMoney = $agencyMoney;
if(isset($business->agency) && $business->agency){ if(isset($business->agency) && $business->agency){
$agencyRedpackUser = Account::findOne([ $agencyRedpackUser = Account::findOne([
["business_code","=",$business->agency->code], ["business_code","=",$business->agency->code],
["type","=",Account::type_business], ["type","=",Account::type_business],
]); ]);
} }
} }