huangzhiguo 2 rokov pred
rodič
commit
1c99c6d131

+ 8 - 4
src/main/resources/mapper/ProductMapper.xml

@@ -10,7 +10,7 @@
 
 			p.tags as tags,
 			p.productRemarks as remarks,
-			p.validFlag as validFlag,
+			IFNULL((SELECT validFlag FROM cm_organize_product_info  WHERE productId = p.productID AND organizeId = 0), 999) AS validFlag,
 			p.productCode as productCode,
 			p.step as step,
 			p.recommendType as recommendType,
@@ -66,10 +66,12 @@
 			p.mainImage as image
 
         from product as p
+		left join cm_organize_product_info copi on copi.productId = p.productId
         left join cm_product_recommend as pr on pr.recommendProductID = p.productID
         where
             pr.productID = #{productId}
-          and p.validFlag  = 2
+          and copi.validFlag  = 2
+		  and copi.organizeId = 0
           and p.visibility = 3
         order by pr.sort desc
 	</select>
@@ -81,7 +83,9 @@
 			IFNULL(p.visibility,3) as visibility,
 			p.productType
 		from product as p
-		where p.validFlag  = 2
+				 left join cm_organize_product_info copi on copi.productId = p.productId
+		where copi.validFlag  = 2
+		  and copi.organizeId = 0
 		  and p.commodityType = (select commodityType from product as p1 where p1.productID = #{productId})
 		  and p.smallTypeID = (select smallTypeID from product as p2 where p2.productID = #{productId})
 		  and p.visibility = 3
@@ -111,7 +115,7 @@
 			p.minBuyNumber as min,
 			p.priceFlag,
 			p.ladderPriceFlag as ladderFlag,
-			p.validFlag as validFlag,
+			IFNULL((SELECT validFlag FROM cm_organize_product_info  WHERE productId = p.productID AND organizeId = 0), 999) AS validFlag,
 			p.productType,
 			p.stock as stock
 		from product p