From 3ea53e61cc23fdb3ddf8b38a199ca60a6da8c407 Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Fri, 28 Nov 2025 18:32:41 +0800
Subject: [PATCH] 添加商品

---
 admin/app/common/model/plus/vip/Apply.php |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/admin/app/common/model/plus/vip/Apply.php b/admin/app/common/model/plus/vip/Apply.php
index e0d50db..ac41bf6 100644
--- a/admin/app/common/model/plus/vip/Apply.php
+++ b/admin/app/common/model/plus/vip/Apply.php
@@ -3,6 +3,8 @@
 namespace app\common\model\plus\vip;
 
 use app\common\model\BaseModel;
+use app\common\model\plus\agent\Referee as agentReferee;
+use app\common\model\plus\agent\User as agentUser;
 use app\common\model\user\User as UserModel;
 use app\common\model\plus\agent\Referee as AgentRefereeModel;
 
@@ -80,12 +82,18 @@
         if (empty($intersect)) {
             return false;
         }
-        
+
         // 检查用户是否已经是VIP用户
         if(User::isVipUser($userId)) {
             return false;
         }
-        
+        //同时成为分销商
+        $referee_id = agentReferee::getRefereeUserId($userId, 1);
+
+        agentUser::add($userId, [
+            'referee_id' => $referee_id,
+            'app_id' => $appId,
+        ]);
         // 新增VIP用户
         User::add($userId, [
             'referee_id' => AgentRefereeModel::getRefereeUserId($userId, 1),

--
Gitblit v1.9.2