커뮤니티 칼럼 기능 수정

dev_bert
kyebyungha 3 years ago
parent e0fade425e
commit 652089120a

@ -5,106 +5,105 @@
SELECT SELECT
x.* x.*
FROM ( FROM (
SELECT <isNotEqual property="bd_tp" compareValue="BF_CT_TP_5">
x.bd_no SELECT
,x.bd_tp x.bd_no
,x.title ,x.bd_tp
,x.content ,x.title
,x.hashtag ,x.content
,x.member_id ,x.hashtag
,z.title as bd_tp_nm ,x.member_id
,IFNULL(star,0) as star ,z.title as bd_tp_nm
,IFNULL(h_nt ,0) as h_nt ,IFNULL(star,0) as star
,(select count(*) ,IFNULL(h_nt ,0) as h_nt
from tbl_bf_board_like tbl ,(select count(*)
where tbl.bd_no = x.bd_no ) as l_nt from tbl_bf_board_like tbl
,(select count(*) where tbl.bd_no = x.bd_no ) as l_nt
from tbl_bf_board_comment tbc ,(select count(*)
where tbc.bd_no = x.bd_no ) as c_nt from tbl_bf_board_comment tbc
,DATE_FORMAT(x.reg_dt,'%H:%i') reg_tm where tbc.bd_no = x.bd_no ) as c_nt
,tbv.v_content ,DATE_FORMAT(x.reg_dt,'%H:%i') reg_tm
,x.thumbnail ,tbv.v_content
,m.profile_path ,x.thumbnail
,m.name ,m.profile_path
,m.nickname ,m.name
,tmf.mt_file_seq ,m.nickname
,tmf.mt_file_local_url ,tmf.mt_file_seq
,ROW_NUMBER() OVER (ORDER BY x.reg_dt DESC) AS row_num ,tmf.mt_file_local_url
FROM tbl_bf_board x ,ROW_NUMBER() OVER (ORDER BY x.h_nt desc, x.bd_no desc) AS row_num
LEFT JOIN tbl_code_item z FROM tbl_bf_board x
on x.bd_tp = z.val_1 and cg_cd ='BF_COMMUNITY_TP' LEFT JOIN tbl_code_item z
LEFT JOIN (select bd_no, group_concat(concat (v_content, '♭⊙♭', nvl(v_nt, 0)) separator '♭§♭') v_content on x.bd_tp = z.val_1 and cg_cd ='BF_COMMUNITY_TP'
from tbl_bf_board_vote group by bd_no) tbv ON tbv.bd_no = x.bd_no LEFT JOIN (select bd_no, group_concat(concat (v_content, '♭⊙♭', nvl(v_nt, 0)) separator '♭§♭') v_content
LEFT JOIN tbl_member m ON m.member_id = x.member_id from tbl_bf_board_vote group by bd_no) tbv ON tbv.bd_no = x.bd_no
LEFT JOIN tbl_bf_board_attach tba ON tba.bd_no = x.bd_no LEFT JOIN tbl_member m ON m.member_id = x.member_id
and tba.file_seq = ( LEFT JOIN tbl_bf_board_attach tba ON tba.bd_no = x.bd_no
SELECT file_seq and tba.file_seq = (
FROM tbl_bf_board_attach fa SELECT file_seq
WHERE fa.bd_no = x.bd_no FROM tbl_bf_board_attach fa
LIMIT 1 WHERE fa.bd_no = x.bd_no
) LIMIT 1
LEFT JOIN tbl_mt_file tmf ON tmf.mt_file_seq = tba.file_seq )
LEFT JOIN tbl_mt_file tmf ON tmf.mt_file_seq = tba.file_seq
WHERE DATE_FORMAT(x.reg_dt,'%Y%M%d') = DATE_FORMAT(now(),'%Y%M%d')
and x.use_yn ='Y' WHERE DATE_FORMAT(x.reg_dt,'%Y%M%d') = DATE_FORMAT(now(),'%Y%M%d')
and x.bd_tp !='BF_CT_TP_5' and x.use_yn ='Y'
<isNotEmpty property="who" prepend=""> <isNotEmpty property="who" prepend="">
AND member_id = #member_id# AND member_id = #member_id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty property="bd_tp" prepend=""> <isNotEmpty property="bd_tp" prepend="">
AND x.bd_tp = #bd_tp# AND x.bd_tp = #bd_tp#
</isNotEmpty> </isNotEmpty>
UNION </isNotEqual>
SELECT <isEqual property="bd_tp" compareValue="BF_CT_TP_5">
x.bd_no SELECT
,x.bd_tp x.bd_no
,x.title ,x.bd_tp
,x.content ,x.title
,x.hashtag ,x.content
,x.member_id ,x.hashtag
,z.title as bd_tp_nm ,x.member_id
,IFNULL(star,0) as star ,z.title as bd_tp_nm
,IFNULL(h_nt ,0) as h_nt ,IFNULL(star,0) as star
,(select count(*) ,IFNULL(h_nt ,0) as h_nt
from tbl_bf_board_like tbl ,(select count(*)
where tbl.bd_no = x.bd_no ) as l_nt from tbl_bf_board_like tbl
,(select count(*) where tbl.bd_no = x.bd_no ) as l_nt
from tbl_bf_board_comment tbc ,(select count(*)
where tbc.bd_no = x.bd_no ) as c_nt from tbl_bf_board_comment tbc
,DATE_FORMAT(x.reg_dt,'%H:%i') reg_tm where tbc.bd_no = x.bd_no ) as c_nt
,tbv.v_content ,DATE_FORMAT(x.reg_dt,'%H:%i') reg_tm
,x.thumbnail ,tbv.v_content
,m.profile_path ,x.thumbnail
,m.name ,m.profile_path
,m.nickname ,m.name
,tmf.mt_file_seq ,m.nickname
,tmf.mt_file_local_url ,tmf.mt_file_seq
,ROW_NUMBER() OVER (ORDER BY x.reg_dt DESC) AS row_num ,tmf.mt_file_local_url
FROM tbl_bf_board x ,ROW_NUMBER() OVER (ORDER BY x.reg_dt DESC) AS row_num
LEFT JOIN tbl_code_item z FROM tbl_bf_board x
on x.bd_tp = z.val_1 and cg_cd ='BF_COMMUNITY_TP' LEFT JOIN tbl_code_item z
LEFT JOIN (select bd_no, group_concat(concat (v_content, '♭⊙♭', nvl(v_nt, 0)) separator '♭§♭') v_content on x.bd_tp = z.val_1 and cg_cd ='BF_COMMUNITY_TP'
from tbl_bf_board_vote group by bd_no) tbv ON tbv.bd_no = x.bd_no LEFT JOIN (select bd_no, group_concat(concat (v_content, '♭⊙♭', nvl(v_nt, 0)) separator '♭§♭') v_content
LEFT JOIN tbl_member m ON m.member_id = x.member_id from tbl_bf_board_vote group by bd_no) tbv ON tbv.bd_no = x.bd_no
LEFT JOIN tbl_bf_board_attach tba ON tba.bd_no = x.bd_no LEFT JOIN tbl_member m ON m.member_id = x.member_id
and tba.file_seq = ( LEFT JOIN tbl_bf_board_attach tba ON tba.bd_no = x.bd_no
SELECT file_seq and tba.file_seq = (
FROM tbl_bf_board_attach fa SELECT file_seq
WHERE fa.bd_no = x.bd_no FROM tbl_bf_board_attach fa
LIMIT 1 WHERE fa.bd_no = x.bd_no
) LIMIT 1
LEFT JOIN tbl_mt_file tmf ON tmf.mt_file_seq = tba.file_seq )
LEFT JOIN tbl_mt_file tmf ON tmf.mt_file_seq = tba.file_seq
WHERE 1 = 1
and x.use_yn ='Y' WHERE 1 = 1
and x.bd_tp ='BF_CT_TP_5' and x.use_yn ='Y'
<isNotEmpty property="who" prepend=""> and x.bd_tp ='BF_CT_TP_5'
AND member_id = #member_id# <isNotEmpty property="who" prepend="">
</isNotEmpty> AND member_id = #member_id#
<isNotEmpty property="bd_tp" prepend=""> </isNotEmpty>
AND x.bd_tp = #bd_tp# LIMIT 8
</isNotEmpty> </isEqual>
LIMIT 8
)x )x
WHERE 1 = 1 WHERE 1 = 1
@ -122,9 +121,7 @@
where member_id = #member_id# where member_id = #member_id#
) )
</isEqual> </isEqual>
</isNotEmpty> </isNotEmpty>
ORDER BY x.h_nt desc, x.l_nt desc, x.bd_no desc
</select> </select>

@ -60,12 +60,12 @@
<!-- 커뮤니티 내용 --> <!-- 커뮤니티 내용 -->
<div class="community_con"> <div class="community_con">
<#if model['bd_tp'] != 'BF_CT_TP_5'> <#if model['bd_tp'] != 'BF_CT_TP_5'>
<div class="small_title_div">
<p class="small_title">오늘의 인기글</p>
</div>
<!-- 오늘의 인기글 목록 -->
<div class="today_hot">
<#if model['lm']?has_content > <#if model['lm']?has_content >
<div class="small_title_div">
<p class="small_title">오늘의 인기글</p>
</div>
<!-- 오늘의 인기글 목록 -->
<div class="today_hot">
<#list model['lm'] as item> <#list model['lm'] as item>
<!-- 태그에 hot 클래스 추가시 노란테두리 생성 --> <!-- 태그에 hot 클래스 추가시 노란테두리 생성 -->
<div class="write_box <#if item?index == 0>hot </#if>" onclick="fncDetail('${item['bd_no']!}')" > <div class="write_box <#if item?index == 0>hot </#if>" onclick="fncDetail('${item['bd_no']!}')" >
@ -107,17 +107,18 @@
</#if> </#if>
</div> </div>
<#else> <#else>
<div class="content img_txt_cont"> <div class="content img_txt_cont">
<div class="txt_box"> <div class="txt_box">
<a href="#" onclick="fncDetail('${item['bd_no']!}')"> ${item['title']!} </a> <a href="#" onclick="fncDetail('${item['bd_no']!}')"> ${item['title']!} </a>
</div> </div>
<#if item['mt_file_seq']?has_content > <#if item['bd_tp'] != "BF_CT_TP_5" && item['mt_file_seq']?has_content >
<div class="img_box"> <div class="img_box">
<img src="${URL_ROOT}/file/get.do?mt_file_seq=${item['mt_file_seq']!}"> <img src="${URL_ROOT}/file/get.do?mt_file_seq=${item['mt_file_seq']!}">
</div> </div>
</#if> </#if>
</div> </div>
</#if> </#if>
<div class="commu_div"> <div class="commu_div">
<div class="nickname_div"> <div class="nickname_div">

@ -13,7 +13,7 @@
height: 1px; height: 1px;
margin: 0; margin: 0;
padding: 0; padding: 0;
border: 0; border: 0;
</style> </style>
<head> <head>
<meta property="og:url" content="https://" /> <meta property="og:url" content="https://" />
@ -128,8 +128,9 @@
</div> </div>
</div> </div>
</#if> </#if>
<!-- //swiper_wrap --> <!-- //swiper_wrap -->
<p class="cont_txt">${model ['rm']['content']!}</p> <p class="cont_txt">
<textarea class="content" cols='150' readOnly style="border: none;padding-left: 130px;">${model ['rm']['content']!}</textarea></p>
</div> </div>
<!-- //community_img --> <!-- //community_img -->
@ -793,12 +794,20 @@
insert_reply(); insert_reply();
}); });
$(".comment_input_cont").hide(); $(".comment_input_cont").hide();
var txtArea = $(".content");
if (txtArea) {
txtArea.each(function(){
$(this).height(this.scrollHeight);
});
}
<#if model['bd_tp']! =='BF_CT_TP_3'> <#if model['bd_tp']! =='BF_CT_TP_3'>
$(".community_write_review").show(); $(".community_write_review").show();
<#else> <#else>
$(".community_write_review").hide(); $(".community_write_review").hide();
</#if> </#if>
}); });

Loading…
Cancel
Save