mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
응답형 댓글의 잘못된 반업데이트 로직 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4299 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
85f0dabdd5
commit
8b49f6fc57
5 changed files with 42 additions and 12 deletions
|
|
@ -159,11 +159,26 @@
|
|||
|
||||
$list_args->head = $parent->head;
|
||||
$list_args->depth = $parent->depth+1;
|
||||
if($list_args->depth<2) $list_args->arrange = $obj->comment_srl;
|
||||
else {
|
||||
$list_args->arrange = $parent->arrange;
|
||||
$output = executeQuery('comment.updateCommentListArrange', $list_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// depth가 2단계 미만이면 별도의 update문 없이 insert만으로 쓰레드 정리
|
||||
if($list_args->depth<2) {
|
||||
$list_args->arrange = $obj->comment_srl;
|
||||
|
||||
// depth가 2단계 이상이면 반업데이트 실행
|
||||
} else {
|
||||
// 부모 댓글과 같은 head를 가지고 depth가 같거나 작은 댓글중 제일 위 댓글을 구함
|
||||
$p_args->head = $parent->head;
|
||||
$p_args->arrange = $parent->arrange;
|
||||
$p_args->depth = $parent->depth;
|
||||
$output = executeQuery('comment.getCommentParentNextSibling', $p_args);
|
||||
|
||||
if($output->data->arrange) {
|
||||
$list_args->arrange = $output->data->arrange;
|
||||
$output = executeQuery('comment.updateCommentListArrange', $list_args);
|
||||
} else {
|
||||
$list_args->arrange = $obj->comment_srl;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
<query id="getCommentListItem" action="select">
|
||||
<tables>
|
||||
<table name="comments" />
|
||||
<table name="comments_list" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
<column name="comments.parent_srl" />
|
||||
<column name="comments_list.*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="comment_srl" var="comment_srl" notnull="notnull" />
|
||||
<condition operation="equal" column="comments.comment_srl" var="comment_srl" notnull="notnull" />
|
||||
<condition operation="equal" column="comments.comment_srl" default="comments_list.comment_srl" notnull="notnull" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
|
|||
|
|
@ -5,16 +5,15 @@
|
|||
</tables>
|
||||
<columns>
|
||||
<column name="comments.*" />
|
||||
<column name="depth" alias="depth" />
|
||||
<column name="comments_list.depth" alias="depth" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="comments_list.document_srl" var="document_srl" notnull="notnull" pipe="and" />
|
||||
<condition operation="equal" column="comments_list.comment_srl" var="comments.comment_srl" filter="number" pipe="and" />
|
||||
<condition operation="more" column="comments_list.head" default="0" pipe="and" />
|
||||
<condition operation="more" column="comments_list.arrange" default="0" pipe="and" />
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="head" order="asc" />
|
||||
<index var="sort_index" default="arrange" order="asc" />
|
||||
<index var="sort_index" default="comment_srl" order="asc" />
|
||||
<list_count var="list_count" default="list_count" />
|
||||
<page_count var="page_count" default="10" />
|
||||
<page var="page" default="1" />
|
||||
|
|
|
|||
13
modules/comment/queries/getCommentParentNextSibling.xml
Normal file
13
modules/comment/queries/getCommentParentNextSibling.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<query id="getCommentParentNextSibling" action="select">
|
||||
<tables>
|
||||
<table name="comments_list" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="min(comments_list.arrange)" alias="arrange" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="comments_list.head" var="head" filter="number" notnull="notnull" />
|
||||
<condition operation="excess" column="comments_list.arrange" var="arrange" filter="number" notnull="notnull" pipe="and" />
|
||||
<condition operation="less" column="comments_list.depth" var="depth" filter="number" notnull="notnull" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -8,6 +8,6 @@
|
|||
<conditions>
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
<condition operation="equal" column="head" var="head" filter="number" notnull="notnull" pipe="and" />
|
||||
<condition operation="excess" column="arrange" var="arrange" filter="number" notnull="notnull" pipe="and" />
|
||||
<condition operation="more" column="arrange" var="arrange" filter="number" notnull="notnull" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue