修复龙珠不能创建代理问题

修复龙珠不能创建代理问题

删除THAgentDB-可编程性-存储过程-user_createUser

执行sql语句

USE [THAgentDB]

GO

/****** Object:  StoredProcedure [dbo].[user_createUser]    Script Date: 2018/7/29 19:48:54 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE proc [dbo].[user_createUser]

(

@UserName varchar(50),

@PassWord varchar(50),

@AgentNo varchar(8),

@UserType int,

@IsurePassword varchar(50),

@IsureScore bigint

)

as

begin

declare @errors int = 0

begin tran

declare @uid int

begin try

–新增代理用户

insert into Users(UserName,PassWord,status,createtime,AgentNo,UserType)

values(

@UserName

,@PassWord

,1

,GETDATE()

,@AgentNo

,@UserType

 

)

select @uid=ISNULL(SCOPE_IDENTITY(),0)

update agentno

setstatus=0

where agentno=@AgentNo

end try

begin catch

set @errors=@errors+1

end catch

if @uid>0

begin

–GSP_GP_RegisterAccounts

–@strAccounts NVARCHAR(31),– 用户帐号

–@strNickName NVARCHAR(31),– 用户昵称

–@strSpreader NVARCHAR(31),– 推荐帐号

–@strLogonPass NCHAR(32),– 登录密码

–@wFaceID SMALLINT,– 头像标识

–@cbGender TINYINT,– 用户性别

–@strPassPortID NVARCHAR(18),– 身份证号

–@strCompellation NVARCHAR(16),– 真实名字

–@strClientIP NVARCHAR(15),– 连接地址

–@strMachineID NCHAR(32),– 机器标识

–@strErrorDescribe NVARCHAR(127) OUTPUT– 输出信息

begin try

declare @error nvarchar(127)

declare @id int

declare @gameUid int

declare @uname NVARCHAR(31)=’AGENTUSER’+CONVERT(varchar(8) , getdate(), 112 )+CAST(CEILING(rand()*1000000)as VARCHAR(8) )

–新增游戏用户

insert into gameUser

exec THAccountsDB.dbo.GSP_GP_RegisterAccountsV2 @uname

,@uname

,”

,@Password

,1

,1

,”

,’代理用户’

,’127.0.0.1′

,”

,@isureScore

,N”

select @id=ISNULL(SCOPE_IDENTITY(),0)

if(@id>0)

begin

select @gameUid=UserId from gameUser where id=@id

–建立用户关系

INSERT INTO UserRelation(AgentUId,GameUId)

values(@uid,@gameUid)

–更新游戏账户的交易密码

UPDATE THAccountsDB.[dbo].AccountsInfo

setInsurePass=@IsurePassword

whereUserId=@gameUid

print 2

–初始化用户银行账户

–if not exists (select 1 from  [THTreasureDB].[dbo].[GameScoreInfo] where userid=@gameUid)

–begin

print @gameUid

–INSERT INTO [THTreasureDB].[dbo].[GameScoreInfo]([UserID],InsureScore)

–values(@gameUid,@IsureScore)

–INSERT INTO [THTreasureDB].[dbo].[GameScoreInfo]([UserID]

—  ,[Score]

—  ,[Revenue]

—  ,[InsureScore]

—  ,[WinCount]

—  ,[LostCount]

—  ,[DrawCount]

—  ,[FleeCount]

—  ,[UserRight]

—  ,[MasterRight]

—  ,[MasterOrder]

—  ,[AllLogonTimes]

—  ,[PlayTimeCount]

—  ,[OnLineTimeCount]

—  ,[LastLogonIP]

—  ,[LastLogonDate]

—  ,[LastLogonMachine]

—  ,[RegisterIP]

—  ,[RegisterDate]

—  ,[RegisterMachine])

–VALUES(@gameUid,0,0,@IsureScore,0,0,0,0,0,0,0,0,0,0,’0.0.0.0′,GETDATE(),”,’0.0.0.0′,GETDATE(),”)

—-end

–升级为VIP会员

EXEC THRecordDB.dbo.WSP_PM_GrantMemberV2 1,’127.0.0.1′,@gameUid,5,”,2000

end

end try

begin catch

print ERROR_MESSAGE()

set @errors=@errors+1

end catch

end

if @errors>0

begin

rollback tran

select 0

end

else

begin

commit tran

select 1

end

end

GO

原创文章,作者:IT攻城狮,如若转载,请注明出处:http://www.itgongchengshi.com/205.html

发表评论

登录后才能评论

联系我们

13373012820

在线咨询:点击这里给我发消息

邮件:22539134@qq.com

工作时间:周一至周五,9:30-18:30,节假日休息