mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 18:51:41 +09:00
최근게시물의 쿼리문을 files, documents 테이블을 직접 join시켜서 존재하는 문서만을 가져오도록 코드 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2946 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
7898bd4d33
commit
9eba8bde28
2 changed files with 15 additions and 24 deletions
|
|
@ -1,20 +1,22 @@
|
|||
<query id="getOneFileInDocument" action="select">
|
||||
<tables>
|
||||
<table name="files" />
|
||||
<table name="files" alias="files"/>
|
||||
<table name="documents" alias="documents"/>
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="upload_target_srl" />
|
||||
<column name="documents.*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="module_srl" var="module_srls" notnull="notnull" filter="numbers" />
|
||||
<condition operation="equal" column="direct_download" var="direct_download" pipe="and" />
|
||||
<condition operation="equal" column="isvalid" var="isvalid" pipe="and" />
|
||||
<condition operation="in" column="files.module_srl" var="module_srls" notnull="notnull" filter="numbers" />
|
||||
<condition operation="equal" column="files.direct_download" var="direct_download" pipe="and" />
|
||||
<condition operation="equal" column="files.isvalid" var="isvalid" pipe="and" />
|
||||
<condition operation="equal" column="files.upload_target_srl" var="documents.document_srl" pipe="and" />
|
||||
</conditions>
|
||||
<groups>
|
||||
<group column="upload_target_srl" />
|
||||
<group column="files.upload_target_srl" />
|
||||
</groups>
|
||||
<navigation>
|
||||
<index var="file_srl" default="file_srl" order="desc" />
|
||||
<index var="list_order" default="documents.list_order" order="asc" />
|
||||
<list_count var="list_count" default="20" />
|
||||
</navigation>
|
||||
</query>
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@
|
|||
if(count($mid_list)==1) $widget_info->module_name = $mid_list[0];
|
||||
|
||||
// 변수 정리
|
||||
$obj->sort_index = $order_target;
|
||||
$obj->list_count = $widget_info->rows_list_count * $widget_info->cols_list_count;
|
||||
|
||||
// mid에 해당하는 module_srl을 구함
|
||||
|
|
@ -73,29 +72,19 @@
|
|||
// 정해진 모듈에서 문서별 파일 목록을 구함
|
||||
$files_output = executeQuery("file.getOneFileInDocument", $obj);
|
||||
|
||||
// 결과에서 문서 번호만을 따로 추출
|
||||
if($files_output->data) {
|
||||
foreach($files_output->data as $key => $val) {
|
||||
$document_srl_list[] = $val->upload_target_srl;
|
||||
}
|
||||
}
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
if(count($document_srl_list)) {
|
||||
|
||||
$documents_output = $oDocumentModel->getDocuments($document_srl_list);
|
||||
if(!count($documents_output)) return;
|
||||
|
||||
foreach($documents_output as $key => $val) {
|
||||
$document_list[] = $val;
|
||||
if(count($files_output->data)) {
|
||||
foreach($files_output->data as $key => $val) {
|
||||
$oDocument = null;
|
||||
$oDocument = $oDocumentModel->getDocument();
|
||||
$oDocument->setAttribute($val);
|
||||
$document_list[] = $oDocument;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$document_count = count($document_list);
|
||||
$total_count = $widget_info->rows_list_count * $widget_info->cols_list_count;
|
||||
for($i=$document_count;$i<$total_count;$i++) $document_list[] = new DocumentItem();
|
||||
|
||||
$widget_info->document_list = $document_list;
|
||||
|
||||
Context::set('widget_info', $widget_info);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue