搜索
 找回密码
 加入

国王选举中加入贡献限制

ctgwglzc 2009-10-10 18:09:23 1240
  1. /****** Object:  Stored Procedure dbo.KING_ELECTION_PROC    Script Date: 6/6/2006 6:03:33 PM ******/
  2. CREATE PROCEDURE [dbo].[KING_ELECTION_PROC]
  3. @strAccountID    char(21),        -- Voted man's account
  4. @strCharID    char(21),        --     Nick's vote
  5. @byNation    tinyint,
  6. @strCandidacyID    char(21),        --     Nick chosen people
  7. @nRet        smallint OUTPUT

  8. AS

  9. DECLARE @nRow smallint

  10. SELECT @nRow = Count(strAccountID) FROM KING_BALLOT_BOX WHERE  strAccountID = @strAccountID
  11. IF @nRow > 0        -- Vote for one person
  12. BEGIN
  13.     SET @nRet = -3
  14.     RETURN
  15. END

  16. DECLARE @Loyalty int
  17. SELECT @Loyalty = Loyalty FROM USERDATA WHERE strUserID = @strCharID
  18. IF @Loyalty < 1000
  19. BEGIN
  20.     SET @nRet = -3
  21.     RETURN
  22. END

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

  25. UPDATE KING_ELECTION_LIST SET nMoney = nMoney + 1
  26. WHERE  byType = 4 and strName = @strCandidacyID

  27. SET @nRet =  1
  28. RETURN
  29. GO
复制代码

4 回复

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
谢谢分享
高级模式
游客