| | |
| | | User::grantMoney($superiorUser['referee_id'], $subsidyAmount, 'VIP专区补贴'); |
| | | |
| | | // 记录分销订单 |
| | | self::createDistributionOrder($order, $superiorUser['referee_id'], $subsidyAmount, 'vip_subsidy'); |
| | | self::createDistributionOrder($order, $superiorUser['referee_id'], $subsidyAmount, 'vip_subsidy',$model['vip_area_money']); |
| | | } |
| | | |
| | | } |
| | |
| | | User::grantMoney($model['vip_area_user_id'], $platformCommissionAmount, '平台直推佣金'); |
| | | |
| | | // 记录分销订单 |
| | | self::createDistributionOrder($order, $model['vip_area_user_id'], $platformCommissionAmount, 'platform_commission'); |
| | | self::createDistributionOrder($order, $model['vip_area_user_id'], $platformCommissionAmount, 'platform_commission',$model['vip_area_money']); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @param $type |
| | | * @return bool |
| | | */ |
| | | protected static function createDistributionOrder($order, $userId, $amount, $type) |
| | | protected static function createDistributionOrder($order, $userId, $amount, $type,$subordinate_money) |
| | | { |
| | | // 创建分销订单记录以跟踪各种类型的佣金 |
| | | $distributionOrder = new self(); |
| | |
| | | 'vip_area_user_id' => $userId, |
| | | 'referee_id' => $order['user_id'], // 被推荐人 |
| | | 'vip_area_money' => $amount, |
| | | 'subordinate_money' => $subordinate_money, |
| | | 'team_revenue' => 0, |
| | | 'vip_area_type' => $vip_area_type, |
| | | 'is_settled' => 1, |