커뮤니티 칼럼 기능 수정

dev_bert
kyebyungha 3 years ago
parent e0fade425e
commit 652089120a

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

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

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

Loading…
Cancel
Save