数据库篇之存储过程[bsp_getfavoriteproductlist](非官方版本)

差异如图:

数据库篇之存储过程[bsp_getfavoriteproductlist](非官方版本)

更新语句如下:

DROP PROCEDURE [bsp_getfavoriteproductlist]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [bsp_getfavoriteproductlist]
@pagesize int,
@pagenumber int,
@uid int
AS
BEGIN
	SET NOCOUNT ON;
	
	IF @pagenumber=1
	BEGIN
		SELECT [temp1].[recordid],[temp1].[uid],[temp1].[state],[temp1].[addtime],[temp1].[pid],[temp2].[name],[temp2].[shopprice],[temp2].[showimg] FROM
		(SELECT TOP(@pagesize) [recordid],[uid],[pid],[state],[addtime] FROM [bsp_favorites] WHERE [uid]=@uid ORDER BY [recordid] DESC) AS [temp1]
		LEFT JOIN [bsp_products] AS [temp2]
		ON [temp1].[pid]=[temp2].[pid]
	END
	ELSE
	BEGIN
		SELECT [temp1].[recordid],[temp1].[uid],[temp1].[state],[temp1].[addtime],[temp1].[pid],[temp2].[name],[temp2].[shopprice],[temp2].[showimg] FROM
		(SELECT TOP(@pagesize) [recordid],[uid],[pid],[state],[addtime] FROM [bsp_favorites] WHERE [uid]=@uid AND [pid] NOT IN
		(SELECT TOP(@pagesize*(@pagenumber-1)) [pid] FROM [bsp_favorites] WHERE [uid]=@uid ORDER BY [recordid] DESC) ORDER BY [recordid] DESC) AS [temp1]
		LEFT JOIN [bsp_products] AS [temp2]
		ON [temp1].[pid]=[temp2].[pid]
	END
	
END
GO


上一篇:Specs satisfying the `flutter_twitter (from `.symlinks/plugins/flutter_twitter/ios`)` dependency were found, but they required a higher minimum deployment target


下一篇:禁止使用USB存储设备