ctgwglzc 发表于 2009-9-22 02:22:15

国王选举中加入贡献限制

/****** Object:Stored Procedure dbo.KING_ELECTION_PROC    Script Date: 6/6/2006 6:03:33 PM ******/
CREATE PROCEDURE .
@strAccountID    char(21),      -- Voted man's account
@strCharID    char(21),      --   Nick's vote
@byNation    tinyint,
@strCandidacyID    char(21),      --   Nick chosen people
@nRet      smallint OUTPUT

AS

DECLARE @nRow smallint

SELECT @nRow = Count(strAccountID) FROM KING_BALLOT_BOX WHEREstrAccountID = @strAccountID
IF @nRow > 0      -- Vote for one person
BEGIN
    SET @nRet = -3
    RETURN
END

DECLARE @Loyalty int
SELECT @Loyalty = Loyalty FROM USERDATA WHERE strUserID = @strCharID
IF @Loyalty < 1000
BEGIN
    SET @nRet = -3
    RETURN
END

INSERT INTO KING_BALLOT_BOX (strAccountID, strCharID, byNation, strCandidacyID )
    VALUES ( @strAccountID, @strCharID, @byNation, @strCandidacyID )

UPDATE KING_ELECTION_LIST SET nMoney = nMoney + 1
WHEREbyType = 4 and strName = @strCandidacyID

SET @nRet =1
RETURN
GO

28085279 发表于 2009-9-22 11:58:57

1# ctgwglzc


哪里控制贡献多少

v123 发表于 2009-9-29 23:29:05

挨~版本那里还没搞好,国王系统,暂时用不着,先收住先

w222222 发表于 2009-9-30 10:06:01

收藏了!!

gjbation1 发表于 2009-10-10 18:09:23

谢谢分享
页: [1]
查看完整版本: 国王选举中加入贡献限制