bin2107 пре 5 година
родитељ
комит
2879f39739

+ 1 - 0
src/main/java/com/style24/front/biz/service/TsfDisplayService.java

@@ -400,6 +400,7 @@ public class TsfDisplayService {
 	public Collection<Goods> getBestItemCategoryGoodsList(Contents contents) {
 		Cate4Srch cate4Srch = new Cate4Srch();
 
+		cate4Srch.setPageGb(contents.getPageGb());
 		cate4Srch.setContentsLoc(contents.getContentsLoc());
 		cate4Srch.setPageable(contents.getPageable());
 		cate4Srch.setPageNo(contents.getPageNo());

+ 5 - 1
src/main/java/com/style24/front/biz/web/TsfDisplayController.java

@@ -696,14 +696,18 @@ public class TsfDisplayController extends TsfBaseController {
 		contents.setPageGb("BEST");
 		MainLayout mainLayout = new MainLayout();
 		mainLayout.setGoodsList(displayService.getBestItemCategoryGoodsList(contents));
-
 		int totalCnt = mainLayout.getGoodsList().size();
+		if(totalCnt>100){
+			totalCnt = 100;
+		}
 		pageable.setTotalCount(totalCnt);
 		contents.setPageable(pageable);
 
 		result.set("paging", contents);
 		result.set("totalCnt", totalCnt);
 		result.set("endRow", pageable.getEndRow());
+		contents.setContentsLoc("SCM003");
+		contents.setPageGb("BEST");
 		result.set("dataList", displayService.getBestItemCategoryGoodsList(contents));
 		return result;
 	}

+ 1 - 0
src/main/java/com/style24/persistence/domain/Cate4Srch.java

@@ -52,6 +52,7 @@ public class Cate4Srch extends TscBaseDomain {
 	private String preview;			// 미리보기 여부 (Y:미리보기)
 
 	private String filterGb;		// 필터 구분값
+	private String pageGb;
 
 	private TscPageRequest pageable;				// 페이징
 	private int pageNo = 1;

+ 59 - 51
src/main/java/com/style24/persistence/mybatis/shop/TsfGoods.xml

@@ -1160,8 +1160,11 @@
 		                 , G.REG_DT DESC
 		                 , G.GOODS_CD) AS NUMB
 		                     </when>
-		                     <when test="contentsLoc == 'SCM002' or contentsLoc == 'SCM003'"> <!-- md추천 -->
+		                     <when test="contentsLoc == 'SCM002' or (contentsLoc == 'SCM003' and pageGb == null)"> <!-- md추천 -->
 		                  , ROW_NUMBER() OVER(ORDER BY CG.DISP_ORD ,G.UPD_DT DESC, G.CURR_PRICE DESC, G.GOODS_CD ASC) AS NUMB
+		                     </when>
+		                     <when test="contentsLoc == 'SCM003' and pageGb != null and pageGb == 'BEST'">
+		                  , ROW_NUMBER() OVER(ORDER BY C4.CATE1_NO, CG.DISP_ORD ,G.UPD_DT DESC, G.CURR_PRICE DESC, G.GOODS_CD ASC) AS NUMB
 		                     </when>
 		                     <otherwise>
 		                 , ROW_NUMBER() OVER(ORDER BY CG.DISP_ORD
@@ -1170,62 +1173,67 @@
 		                     </otherwise>
 		                 </choose>
 		            <choose>
-						<when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007'"> <!-- md추천 -->
-							FROM	TB_CONTENTS CT
-							, TMP_CONTENTS_GOODS CTG
-							, TB_GOODS G
-							, TB_GOODS_STOCK S
-							, TB_BRAND B
-							, TB_BRAND_GROUP BG
-							WHERE	CT.CONTENTS_LOC = CTG.CONTENTS_LOC
-							AND 	CT.DISP_ORD = CTG.CONTENTS_SQ
-							AND		CTG.GOODS_CD = G.GOODS_CD
-							AND		CTG.GOODS_CD = S.GOODS_CD
-							AND		G.BRAND_CD = B.BRAND_CD
-							AND     B.BRAND_GROUP_NO = BG.BRAND_GROUP_NO
-							AND		CT.CONTENTS_LOC = #{contentsLoc}
-						    AND 	CTG.CONTENTS_SQ = #{dispOrd}
-							AND		NOW() BETWEEN CT.DISP_STDT AND CT.DISP_EDDT
-						</when>
-		            	<otherwise>
-							FROM   TB_CATE_4SRCH C4
-							, TB_CATE_GOODS CG
-							, TB_GOODS G
-							, TB_GOODS_STOCK S
-							, TB_BRAND B
-							, TB_BRAND_GROUP BG
-							<if test="contentsLoc == 'SCM002'"> <!-- 베스트 -->
-								, TB_GOODS_SUMMARY GS
-							</if>
-							WHERE  C4.LEAF_CATE_NO = CG.CATE_NO
-							<choose>
-								<when test="brandGroupNo != null and brandGroupNo != ''">
-									AND    CG.BRAND_GROUP_NO = #{brandGroupNo}
-								</when>
-								<otherwise>
-									AND    CG.BRAND_GROUP_NO = 0 /*브랜드메인에서 접근한 것이 아니면*/
-								</otherwise>
-							</choose>
-							AND    CG.GOODS_CD = G.GOODS_CD
-							AND    CG.GOODS_CD = S.GOODS_CD
-							AND    G.BRAND_CD = B.BRAND_CD
-							AND    B.BRAND_GROUP_NO = BG.BRAND_GROUP_NO
-							<if test="contentsLoc == 'SCM002'"> <!-- 베스트 -->
-								AND    CG.GOODS_CD = GS.GOODS_CD
-							</if>
-							AND    C4.SITE_CD = #{siteCd}
-							AND    C4.CATE_GB = #{cateGb}
-							AND    C4.CATE_TYPE = 'G031_20' /*컨텐츠카테고리*/
-							AND    C4.CATE1_NO = #{cate1No}
-							AND    C4.CONTENTS_LOC = #{contentsLoc}
-						</otherwise>
-					</choose>
+		                <when test="contentsLoc == 'SMM009' or contentsLoc == 'SMM007'"> <!-- md추천 -->
+		                    FROM	TB_CONTENTS CT
+		                    , TMP_CONTENTS_GOODS CTG
+		                    , TB_GOODS G
+		                    , TB_GOODS_STOCK S
+		                    , TB_BRAND B
+		                    , TB_BRAND_GROUP BG
+		                    WHERE	CT.CONTENTS_LOC = CTG.CONTENTS_LOC
+		                    AND 	CT.DISP_ORD = CTG.CONTENTS_SQ
+		                    AND		CTG.GOODS_CD = G.GOODS_CD
+		                    AND		CTG.GOODS_CD = S.GOODS_CD
+		                    AND		G.BRAND_CD = B.BRAND_CD
+		                    AND     B.BRAND_GROUP_NO = BG.BRAND_GROUP_NO
+		                    AND		CT.CONTENTS_LOC = #{contentsLoc}
+		                    AND 	CTG.CONTENTS_SQ = #{dispOrd}
+		                    AND		NOW() BETWEEN CT.DISP_STDT AND CT.DISP_EDDT
+		                </when>
+		                <otherwise>
+		                    FROM   TB_CATE_4SRCH C4
+		                    , TB_CATE_GOODS CG
+		                    , TB_GOODS G
+		                    , TB_GOODS_STOCK S
+		                    , TB_BRAND B
+		                    , TB_BRAND_GROUP BG
+		                    <if test="contentsLoc == 'SCM002'"> <!-- 베스트 -->
+		                    , TB_GOODS_SUMMARY GS
+		                    </if>
+		                    WHERE  C4.LEAF_CATE_NO = CG.CATE_NO
+		                    <choose>
+		                        <when test="brandGroupNo != null and brandGroupNo != ''">
+		                    AND    CG.BRAND_GROUP_NO = #{brandGroupNo}
+		                        </when>
+		                        <otherwise>
+		                    AND    CG.BRAND_GROUP_NO = 0 /*브랜드메인에서 접근한 것이 아니면*/
+		                        </otherwise>
+		                    </choose>
+		                    AND    CG.GOODS_CD = G.GOODS_CD
+		                    AND    CG.GOODS_CD = S.GOODS_CD
+		                    AND    G.BRAND_CD = B.BRAND_CD
+		                    AND    B.BRAND_GROUP_NO = BG.BRAND_GROUP_NO
+		                    <if test="contentsLoc == 'SCM002'"> <!-- 베스트 -->
+		                    AND    CG.GOODS_CD = GS.GOODS_CD
+	                        </if>
+	                        AND    C4.SITE_CD = #{siteCd}
+	                        AND    C4.CATE_GB = #{cateGb}
+	                        AND    C4.CATE_TYPE = 'G031_20' /*컨텐츠카테고리*/
+	                        <if test="pageGb == null or pageGb != 'BEST'">
+		                    AND    C4.CATE1_NO = #{cate1No}
+		                    </if>
+		                    AND    C4.CONTENTS_LOC = #{contentsLoc}
+		              </otherwise>
+		           </choose>
 		            AND    G.GOODS_STAT = 'G008_90' /*승인완료상품*/
 		            AND    G.SELF_MALL_YN = 'Y'   /*몰노출상품*/
 		            AND    NOW() BETWEEN G.SELL_STDT AND G.SELL_EDDT   /*판매기간*/
 		            AND    S.STOCK_QTY <![CDATA[>]]> 0 /*재고있는상품*/
 		            AND    B.USE_YN = 'Y'
 		            AND    BG.USE_YN = 'Y'
+		            <if test="pageGb != null and pageGb == 'BEST'">
+		            ORDER BY C4.CATE1_NO
+		            </if>
 		           ) G
 		    WHERE  1=1
 		<if test="pageable != null and pageable.endRow != null and pageable.endRow > 0">

+ 1 - 1
src/main/webapp/WEB-INF/views/web/display/BestMainFormWeb.html

@@ -270,7 +270,7 @@
 
 	<script src="/ux/plugins/gaga/gaga.infinite.scrollSession.js"></script>
 	<script src="/ux/plugins/jquery/jquery.history.min.js"></script>
-	<script th:src="@{'/biz/goodsSession.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/biz/goodsSession.js"></script>
+	<script th:src="@{'/biz/goods.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/biz/goods.js"></script>
 
 	<script th:inline="javascript">
 /*<![CDATA[*/