mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 04:24:14 +09:00
#19435955: 진행중(질의 오류 수정, 실행 코드 추가), 동작 검증 필요.
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@8020 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
f4373b04c4
commit
247f88eeb8
5 changed files with 77 additions and 4 deletions
|
|
@ -27,10 +27,61 @@
|
||||||
CUBRID를 사용하지 않는 경우에만 보편적인 기존 질의문을 사용합니다. */
|
CUBRID를 사용하지 않는 경우에만 보편적인 기존 질의문을 사용합니다. */
|
||||||
$db_info = Context::getDBInfo ();
|
$db_info = Context::getDBInfo ();
|
||||||
if ($db_info->db_type != "cubrid") {
|
if ($db_info->db_type != "cubrid") {
|
||||||
|
debugPrint ("importer: DEBUG - Non CUBRID DBMS detected.");
|
||||||
$output = executeQuery('importer.updateDocumentSync');
|
$output = executeQuery('importer.updateDocumentSync');
|
||||||
$output = executeQuery('importer.updateCommentSync');
|
$output = executeQuery('importer.updateCommentSync');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
debugPrint ("importer: DEBUG - CUBRID DBMS detected.");
|
||||||
|
$output = executeQueryArray ('importer.getDocumentMemberSrlWithUserID');
|
||||||
|
if (is_array ($output) && count ($output)) {
|
||||||
|
debugPrint ("importer: DEBUG - collect userid-membersrl pair for documents success.");
|
||||||
|
$success_count = 0;
|
||||||
|
$error_count = 0;
|
||||||
|
$total_count = 0;
|
||||||
|
foreach ($output as $val) {
|
||||||
|
$args->user_id = $val->user_id;
|
||||||
|
$args->member_srl = $val->member_srl;
|
||||||
|
$tmp = executeQuery ('importer.updateDocumentSyncForCUBRID', $args);
|
||||||
|
if ($tmp->toBool () === true) {
|
||||||
|
$success_count++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$error_count++;
|
||||||
|
}
|
||||||
|
$total_count++;
|
||||||
|
}
|
||||||
|
debugPrint ("importer: Statistics of change owner for documents.\n".
|
||||||
|
sprintf ("Total: %d, Success: %d, Error: %d.",
|
||||||
|
$total_count, $success_count, $error_count
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} // documents section
|
||||||
|
|
||||||
|
$output = executeQueryArray ('importer.getCommentMemberSrlWithUserID');
|
||||||
|
if (is_array ($output) && count ($output)) {
|
||||||
|
debugPrint ("importer: DEBUG - collect userid-membersrl pair for comments success.");
|
||||||
|
$success_count = 0;
|
||||||
|
$error_count = 0;
|
||||||
|
$total_count = 0;
|
||||||
|
foreach ($output as $val) {
|
||||||
|
$args->user_id = $val->user_id;
|
||||||
|
$args->member_srl = $val->member_srl;
|
||||||
|
$tmp = executeQuery ('importer.updateCommentSyncForCUBRID', $args);
|
||||||
|
if ($tmp->toBool () === true) {
|
||||||
|
$success_count++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$error_count++;
|
||||||
|
}
|
||||||
|
$total_count++;
|
||||||
|
}
|
||||||
|
debugPrint ("importer: Statistics of change owner for documents.\n".
|
||||||
|
sprintf ("Total: %d, Success: %d, Error: %d.",
|
||||||
|
$total_count, $success_count, $error_count
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} // comments section
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setMessage('msg_sync_completed');
|
$this->setMessage('msg_sync_completed');
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<query id="updateDocumentSync" action="select">
|
<query id="getCommentMemberSrlWithUserID" action="select">
|
||||||
<tables>
|
<tables>
|
||||||
<table name="comment" alias="comment" />
|
<table name="comments" alias="comments" />
|
||||||
<table name="member" alias="member" />
|
<table name="member" alias="member" />
|
||||||
</tables>
|
</tables>
|
||||||
<columns>
|
<columns>
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
<column name="member.user_id" alias="user_id" />
|
<column name="member.user_id" alias="user_id" />
|
||||||
</columns>
|
</columns>
|
||||||
<conditions>
|
<conditions>
|
||||||
<condition operation="equal" column="comment.user_id" default="member.user_id" filter="userid" />
|
<condition operation="equal" column="comments.user_id" default="member.user_id" filter="userid" />
|
||||||
</conditions>
|
</conditions>
|
||||||
<group>
|
<group>
|
||||||
<group column="member_srl" />
|
<group column="member_srl" />
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<query id="updateDocumentSync" action="select">
|
<query id="getDocumentMemberSrlWithUserID" action="select">
|
||||||
<tables>
|
<tables>
|
||||||
<table name="documents" alias="documents" />
|
<table name="documents" alias="documents" />
|
||||||
<table name="member" alias="member" />
|
<table name="member" alias="member" />
|
||||||
|
|
|
||||||
11
modules/importer/queries/updateCommentSyncForCUBRID.xml
Normal file
11
modules/importer/queries/updateCommentSyncForCUBRID.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<query id="updateCommentSyncForCUBRID" action="update">
|
||||||
|
<tables>
|
||||||
|
<table name="comments" alias="comments" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="comments.member_srl" var="member_srl" filter="number" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="comments.user_id" var="user_id" />
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
11
modules/importer/queries/updateDocumentSyncForCUBRID.xml
Normal file
11
modules/importer/queries/updateDocumentSyncForCUBRID.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<query id="updateDocumentSyncForCUBRID" action="update">
|
||||||
|
<tables>
|
||||||
|
<table name="documents" alias="documents" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="documents.member_srl" var="member_srl" filter="number" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="documents.user_id" var="user_id" />
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue