mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
add function for tag model
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6253 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
5133172684
commit
ee497f0f0e
3 changed files with 76 additions and 0 deletions
12
modules/tag/queries/getDocumentSrlByTag.xml
Normal file
12
modules/tag/queries/getDocumentSrlByTag.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<query id="getDocumentSrlByTag" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="tags" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="document_srl" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="in" column="module_srl" var="module_srl" filter="number" />
|
||||||
|
<condition operation="equal" column="tag" var="tag" notnull="notnull" pipe="and" />
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
18
modules/tag/queries/getDocumentsTagList.xml
Normal file
18
modules/tag/queries/getDocumentsTagList.xml
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<query id="getTagWithUsedList" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="tags" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="tag" />
|
||||||
|
<column name="count(*)" alias="count" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="in" column="document_srl" var="document_srl" />
|
||||||
|
</conditions>
|
||||||
|
<navigation>
|
||||||
|
<index var="count" default="count" order="desc" />
|
||||||
|
</navigation>
|
||||||
|
<groups>
|
||||||
|
<group column="tag" />
|
||||||
|
</groups>
|
||||||
|
</query>
|
||||||
|
|
@ -34,5 +34,51 @@
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief tag로 document_srl를 가져오기
|
||||||
|
**/
|
||||||
|
function getDocumentSrlByTag($obj){
|
||||||
|
if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl);
|
||||||
|
else $args->module_srl = $obj->module_srl;
|
||||||
|
|
||||||
|
$args->tag = $obj->tag;
|
||||||
|
$output = executeQueryArray('tag.getDocumentSrlByTag', $args);
|
||||||
|
if(!$output->toBool()) return $output;
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief document 에서 사용된 tag 가져오기
|
||||||
|
**/
|
||||||
|
function getDocumentsTagList($obj){
|
||||||
|
if(is_array($obj->document_srl)) $args->document_srl = implode(',', $obj->document_srl);
|
||||||
|
else $args->document_srl = $obj->document_srl;
|
||||||
|
|
||||||
|
$output = executeQueryArray('tag.getDocumentsTagList', $args);
|
||||||
|
if(!$output->toBool()) return $output;
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 특정tag과 함께 사용된 tag목록
|
||||||
|
**/
|
||||||
|
function getTagWithUsedList($obj){
|
||||||
|
if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl);
|
||||||
|
else $args->module_srl = $obj->module_srl;
|
||||||
|
|
||||||
|
$args->tag = $obj->tag;
|
||||||
|
$output = $this->getDocumentSrlByTag($args);
|
||||||
|
$document_srl = array();
|
||||||
|
|
||||||
|
foreach($output->data as $k => $v) $document_srl[] = $v->document_srl;
|
||||||
|
unset($args);
|
||||||
|
$args->document_srl = $document_srl;
|
||||||
|
$output = $this->getDocumentsTagList($args);
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue