From a90ac240c499e686793744b25732b6ac6a57edfd Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Wed, 26 Nov 2025 10:46:51 +0800
Subject: [PATCH] 1、商家端添加会员管理 2、修复分会绑定会长时获取获取会员信息报错 3、修复添加分会成员是没保存分会id问题 4、修复获取分会成员时获取的是所有的分会的成员

---
 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