quanwei
2025-12-04 12913c1069347ea4b1f6ab87f480da0f8d8c646a
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),