Browse Source

몰메인 신상품 쿼리 수정

bin2107 4 years ago
parent
commit
d74cec7628

+ 28 - 13
src/main/java/com/style24/persistence/mybatis/shop/TsfGoods.xml

@@ -1841,8 +1841,7 @@
 		         , G.GOODS_TNM          /*상품타이틀명*/
 		         , G.MAIN_COLOR_CD      /*대표색상코드*/
 		         , G.LIST_PRICE         /*정상가(최초판매가)*/
-		, G.CURR_PRICE         /*현재판매가*/
-		         , G.REG_DT             /*등록일시*/
+		         , G.CURR_PRICE         /*현재판매가*/
 		    FROM   (
 		            SELECT DISTINCT CASE WHEN BG.DISP_NM_LANG = 'EN' THEN
 		                            BG.BRAND_GROUP_ENM
@@ -1860,9 +1859,23 @@
 		                 , G.MAIN_COLOR_CD                                          /*대표색상코드*/
 		                 , G.LIST_PRICE                                             /*정상가(최초판매가)*/
 		                 , G.CURR_PRICE                                             /*현재판매가*/
-		                 , G.REG_DT                                                 /*등록일시*/
+		                <choose>
+		                	<when test="brandGroupNo != null and brandGroupNo != ''">
+		                		, G.REG_DT                                                 /*등록일시*/
+		                	</when>
+		                	<otherwise>
+		                		, CG.DISP_ORD
+		                	</otherwise>
+		                </choose>
 		            FROM   TB_CATE_4SRCH C4
-		                 , TB_CATE_GOODS CG
+		            <choose>
+		                <when test="brandGroupNo != null and brandGroupNo != ''">
+		                , TB_CATE_GOODS CG
+		                </when>
+		                <otherwise>
+		                , TB_CATE_GOODS_RECENT CG
+		                </otherwise>
+		            </choose>
 		                 , TB_GOODS G
 		                 , TB_GOODS_STOCK GS
 		                 , TB_BRAND B
@@ -1878,16 +1891,11 @@
 		            <if test="cate1No != null and cate1No != ''">
 		            AND    C4.CATE1_NO = #{cate1No}
 		            </if>
-		            <choose>
-		                <when test="brandGroupNo != null and brandGroupNo != ''">
+		            <if test="brandGroupNo != null and brandGroupNo != ''">
 		            AND    B.BRAND_GROUP_NO = #{brandGroupNo}
-		                </when>
-		                <otherwise>
-		            AND    CG.BRAND_GROUP_NO = 0 /*브랜드메인에서 접근한 것이 아니면*/
-		                </otherwise>
-		            </choose>
+		            </if>
 		            <if test="exceptGoodsArr != null and exceptGoodsArr.length > 0">
-		            AND	   CG.GOODS_CD NOT IN
+		            AND	   G.GOODS_CD NOT IN
 		                <foreach collection="exceptGoodsArr" item="item" index="index"  open="(" close=")" separator=",">
 		                #{item}
 		                </foreach>
@@ -1899,7 +1907,14 @@
 		            AND    GS.STOCK_QTY <![CDATA[>]]> 0 /*재고있는상품*/
 		            AND    B.USE_YN = 'Y'
 		            AND    BG.USE_YN = 'Y'
-		            ORDER BY G.REG_DT DESC, G.GOODS_CD
+		        <choose>
+		        	<when test="brandGroupNo != null and brandGroupNo != ''">
+		        		ORDER BY G.REG_DT DESC, G.GOODS_CD
+		        	</when>
+		        	<otherwise>
+		        		ORDER BY CG.DISP_ORD
+		        	</otherwise>
+		        </choose>
 		            <if test="maxRow != null and maxRow !=''">
 		            LIMIT #{maxRow}
 		            </if>

+ 24 - 3
src/main/webapp/WEB-INF/views/web/common/fragments/GnbWeb.html

@@ -138,6 +138,7 @@
 // 				}
 // 		});
 // 	}
+	var bannerCloseYn = 'Y';
 	
 	// GNB탭 > 카테고리
 	let fnGetGnbCategory = function(cate1) {
@@ -420,7 +421,7 @@
 							let tag = '';
 
 							if(item.contentsType == 'OPEN'){
-								tag +='<div class="bnrtype_open" style="background-color:#'+item.strVar5+';">';
+								tag +='<div class="bnrtype_open" style="background-color:#'+item.strVar5.replaceAll('#','')+';">';
 								if(item.strVar7=='IMG'){
 									tag +=' 	<a href="'+item.strVar1+'" target="">';
 									tag +=' 		<img src="'+bannerImgUrl+''+item.imgPath1+'" alt="">';
@@ -449,8 +450,19 @@
 									tag+=' 	<button id="btn_close_bnr" class="btn_close" onclick="fnGnbTobBannerClose(1);"><span>닫기</span></button>';
 									tag+='</div>';
 								// }
+								if($(".open_bnr_area").text() == '열기'){
+									$('.close_bnr_area').show();
+								}else{
+									if(item.strVar8=='Y'){
+										$('.close_bnr_area').show();
+										bannerCloseYn = 'Y';
+									}else{
+										$('.close_bnr_area').hide();
+										bannerCloseYn = 'N';
+									}
+								}
 							}else if(item.contentsType == 'IMG'){
-								tag+='<div class="bnrtype_img" style="background-color:#'+item.strVar5+';">';
+								tag+='<div class="bnrtype_img" style="background-color:#'+item.strVar5.replaceAll('#','')+';">';
 								tag+=' 	<a href="'+item.strVar1+'" target="">';
 								tag+=' 		<img src="'+bannerImgUrl+''+item.imgPath1+'" alt=""/>';
 								tag+=' 	</a>';
@@ -568,7 +580,16 @@
 			$('body').toggleClass('lock');
 			$('.bnrtype_open').toggleClass('fixed');
 			$(this).text($(this).text() == '열기' ? '닫기' : '열기');
-			$(this).text() == '열기' ? $('.close_bnr_area').show() : $('.close_bnr_area').hide();
+			// $(this).text() == '열기' ? $('.close_bnr_area').show() : $('.close_bnr_area').hide();
+			if(bannerCloseYn == 'N'){
+				if($(this).text() == '열기'){
+					$('.close_bnr_area').show();
+				}else{
+					$('.close_bnr_area').hide();
+				}
+			}else{
+				$('.close_bnr_area').show();
+			}
 		});
 		
 		// GNB toggle