$userId, 'apply_status' => 10]); log_write($existing); if ($existing) { return false; } log_write(OperationsModel::isregionUser($userId)); // 检查用户是否已经是运营中心 if (OperationsModel::isregionUser($userId)) { return false; } // 获取用户信息 $user = UserModel::detail($userId); if (!$user) { return false; } // 生成运营中心入驻申请(管辖区域在审核时分配,默认为0) $data = [ 'user_id' => $userId, 'real_name' => $user['nickName'] ?: $user['userName'], 'mobile' => $user['mobile'] ?: '', 'referee_id' => $user['referee_id'] ?: 0, 'province_id' => 0, 'city_id' => 0, 'area_id' => 0, 'region_level' => 1, // 默认为省级,审核时可调整 'apply_type' => 10, // 需要后台审核 'apply_status' => 10, // 待审核 'apply_time' => time(), 'audit_time' => 0, 'reject_reason' => '', 'app_id' => $appId, ]; // 保存申请记录 return $this->save($data) !== false; } }