* code for task#1552.

This commit is contained in:
xia0ta0
2013-07-22 16:18:27 +08:00
parent 78b1ffdfa0
commit 01f65195c3
7 changed files with 52 additions and 12 deletions
+18
View File
@@ -803,6 +803,24 @@ class treeModel extends model
return $this->dao->select('name')->from(TABLE_PRODUCT)->where('id')->eq($module->root)->fetch();
}
/**
* Get the module that its type == 'story'.
*
* @param int $moduleID
* @access public
* @return void
*/
public function getStoryModule($moduleID)
{
$module = $this->dao->select('id,type,parent')->from(TABLE_MODULE)->where('id')->eq($moduleID)->fetch();
while($module->id and $module->type != 'story')
{
$module = $this->dao->select('id,type,parent')->from(TABLE_MODULE)->where('id')->eq($module->parent)->fetch();
}
return $module->id;
}
/**
* Update modules' order.
*