📄 cs_points_calculateforpostandauthor.prc
字号:
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[cs_Points_CalculateForPostAndAuthor]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[cs_Points_CalculateForPostAndAuthor]
GO
--------------------------------------------------------------------------------
-- cs_Points_CalculateForPostAndAuthor
-- Calculates the points for a post and its author
--------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[cs_Points_CalculateForPostAndAuthor]
(
@SettingsID int,
@PostID int,
@PostFactor int,
@ReplyFactor int,
@ReplierFactor int,
@RatingFactor int,
@DownloadFactor int,
@DownloaderFactor int,
@FavoritePostFactor int,
@FavoriteUserFactor int,
@RaterFactor int,
@ForumRatingType int
)
AS
SET NOCOUNT ON
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
-- recalculate post points
EXECUTE cs_Points_CalculateForPost @SettingsID, @PostID, @PostFactor, @ReplyFactor, @ReplierFactor, @RatingFactor, @DownloadFactor, @DownloaderFactor, @FavoritePostFactor, @ForumRatingType
-- get post author
DECLARE @UserID int
EXECUTE cs_Post_GetAuthorID @SettingsID, @PostID, @UserID OUTPUT
-- recalculate author points
EXECUTE cs_Points_CalculateForUser @SettingsID, @UserID, @FavoriteUserFactor, @RaterFactor, @ForumRatingType
RETURN
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
GRANT EXECUTE on [dbo].[cs_Points_CalculateForPostAndAuthor] to [public]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -