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