日期:2014-05-17 浏览次数:20500 次
if @FromPT<>'all'
WHILE @Next <= dbo.Get_StrArrayLength(@ProductIDs,',') --循环id集合
BEGIN
SET @CurrProductID = CONVERT(int,dbo.Get_StrArrayStrOfIndex(@ProductIDs,',',@Next))
INSERT INTO #ProductTmp ([FromPT],[ProductId], [Price])
SELECT
p.FromPT,
P.ProductID,
ISNULL((SELECT MIN(cn_Price) FROM Nop_Productvariant WHERE ProductID = P.ProductId and FromPT=@FromPT),0) AS Price
FROM
Nop_Product P
WHERE
P.ProductID = @CurrProductID AND Deleted = 0
and p.FromPT=@FromPT
SET @Next=@Next+1
END
if @FromPT<>'all'
WHILE @Next <= dbo.Get_StrArrayLength(@ProductIDs,',') --循环id集合
BEGIN
SET @CurrProductID = CONVERT(int,dbo.Get_StrArrayStrOfIndex(@ProductIDs,',',@Next))
INSERT INTO #ProductTmp ([FromPT],[ProductId], [Price])
SELECT p.FromPT,P.ProductID,
case @FromPT when'中国' then cn_Price when'英国' then en_Price end as price
FROM Nop_Product P
LEFT JOIN Nop_Productvariant T ON T.ProductID = P.ProductId AND T.FromPT=@FromPT
WHERE P.ProductID = @CurrProductID AND Deleted = 0 and p.FromPT=@FromPT
SET @Next=@Next+1
END