* change the divider of order by, use ?\001 instead of |.
This commit is contained in:
@@ -47,7 +47,7 @@ class bug extends control
|
||||
}
|
||||
|
||||
/* 浏览一个产品下面的bug。*/
|
||||
public function browse($productID = 0, $browseType = 'byModule', $param = 0, $orderBy = 'id|desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
public function browse($productID = 0, $browseType = 'byModule', $param = 0, $orderBy = 'iddesc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
/* 设置产品id和模块id。*/
|
||||
$browseType = strtolower($browseType);
|
||||
|
||||
@@ -62,7 +62,7 @@ class bugModel extends model
|
||||
}
|
||||
|
||||
/* 获得某一个产品,某一个模块下面的所有bug。*/
|
||||
public function getModuleBugs($productID, $moduleIds = 0, $orderBy = 'id|desc', $pager = null)
|
||||
public function getModuleBugs($productID, $moduleIds = 0, $orderBy = 'iddesc', $pager = null)
|
||||
{
|
||||
$sql = $this->dao->select('*')->from(TABLE_BUG)->where('product')->eq((int)$productID);
|
||||
if(!empty($moduleIds)) $sql->andWhere('module')->in($moduleIds);
|
||||
@@ -248,7 +248,7 @@ class bugModel extends model
|
||||
}
|
||||
|
||||
/* 获得某个项目的bug列表。*/
|
||||
public function getProjectBugs($projectID, $orderBy = 'id|desc', $pager = null)
|
||||
public function getProjectBugs($projectID, $orderBy = 'iddesc', $pager = null)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_BUG)->where('project')->eq((int)$projectID)->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ EOT;
|
||||
}
|
||||
else
|
||||
{
|
||||
$orderBy = $fieldName . '|' . 'asc';
|
||||
$orderBy = $fieldName . '' . 'asc';
|
||||
}
|
||||
$link = helper::createLink($module, $method, sprintf($vars, $orderBy));
|
||||
echo html::a($link, $label);
|
||||
|
||||
@@ -49,7 +49,7 @@ class product extends control
|
||||
}
|
||||
|
||||
/* 浏览某一个产品。*/
|
||||
public function browse($productID = 0, $browseType = 'byModule', $param = 0, $orderBy = 'id|desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
public function browse($productID = 0, $browseType = 'byModule', $param = 0, $orderBy = 'iddesc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
/* 设置搜索条件。*/
|
||||
$this->config->product->search['actionURL'] = $this->createLink('product', 'browse', "productID=$productID&browseType=bySearch");
|
||||
|
||||
@@ -73,7 +73,7 @@ class project extends control
|
||||
}
|
||||
|
||||
/* 浏览某一个项目下面的任务。*/
|
||||
public function task($projectID = 0, $orderBy = 'status|asc,id|desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
public function task($projectID = 0, $orderBy = 'statusasc,iddesc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
/* 公共的操作。*/
|
||||
$project = $this->commonAction($projectID);
|
||||
@@ -160,7 +160,7 @@ class project extends control
|
||||
}
|
||||
|
||||
/* 浏览某一个项目下面的需求。*/
|
||||
public function story($projectID = 0, $orderBy = 'status|desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
public function story($projectID = 0, $orderBy = 'statusdesc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
/* 加载story, user模块,加载task模块的语言。*/
|
||||
$this->loadModel('story');
|
||||
@@ -199,7 +199,7 @@ class project extends control
|
||||
}
|
||||
|
||||
/* 浏览某一个项目下面的bug。*/
|
||||
public function bug($projectID = 0, $orderBy = 'status,id|desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
public function bug($projectID = 0, $orderBy = 'status,iddesc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
/* 加载bug和user模块。*/
|
||||
$this->loadModel('bug');
|
||||
|
||||
@@ -98,7 +98,7 @@ class projectModel extends model
|
||||
/* 获得项目id=>name列表。*/
|
||||
public function getPairs()
|
||||
{
|
||||
return $this->dao->select('id,name')->from(TABLE_PROJECT)->where('iscat')->eq(0)->andwhere('company')->eq($this->app->company->id)->orderBy('status, end|desc')->fetchPairs();
|
||||
return $this->dao->select('id,name')->from(TABLE_PROJECT)->where('iscat')->eq(0)->andwhere('company')->eq($this->app->company->id)->orderBy('status, enddesc')->fetchPairs();
|
||||
}
|
||||
|
||||
/* 获得完整的列表。*/
|
||||
@@ -106,7 +106,7 @@ class projectModel extends model
|
||||
{
|
||||
$sql = $this->dao->select('*')->from(TABLE_PROJECT)->where('iscat')->eq(0)->andwhere('company')->eq($this->app->company->id);
|
||||
if($status != 'all') $sql->andWhere('status')->in($status);
|
||||
return $sql->orderBy('status, end|desc')->fetchAll();
|
||||
return $sql->orderBy('status, enddesc')->fetchAll();
|
||||
}
|
||||
|
||||
/* 通过Id获取项目信息。*/
|
||||
@@ -271,7 +271,7 @@ class projectModel extends model
|
||||
/* 没有指定结束日期的情况。*/
|
||||
if($project->end == '0000-00-00')
|
||||
{
|
||||
$sets = $sql->orderBy('date|desc')->limit(14)->fetchAll('name');
|
||||
$sets = $sql->orderBy('datedesc')->limit(14)->fetchAll('name');
|
||||
$sets = array_reverse($sets);
|
||||
|
||||
/* 如果没有记录,手工补齐。*/
|
||||
|
||||
@@ -341,7 +341,7 @@ class storyModel extends model
|
||||
}
|
||||
|
||||
/* 获得某一个产品某一个模块下面的所有需求列表。*/
|
||||
public function getProductStories($productID = 0, $moduleIds = 0, $status = 'all', $orderBy = 'id|desc', $pager = null)
|
||||
public function getProductStories($productID = 0, $moduleIds = 0, $status = 'all', $orderBy = 'iddesc', $pager = null)
|
||||
{
|
||||
return $this->dao->select('t1.*, t2.title as planTitle')
|
||||
->from(TABLE_STORY)->alias('t1')
|
||||
@@ -353,7 +353,7 @@ class storyModel extends model
|
||||
}
|
||||
|
||||
/* 获得某一个产品某一个模块下面的所有需求id=>title列表。*/
|
||||
public function getProductStoryPairs($productID = 0, $moduleIds = 0, $status = 'all', $order = 'id|desc')
|
||||
public function getProductStoryPairs($productID = 0, $moduleIds = 0, $status = 'all', $order = 'iddesc')
|
||||
{
|
||||
$sql = $this->dao->select('t1.id, t1.title, t1.module, t2.name AS product')
|
||||
->from(TABLE_STORY)->alias('t1')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
|
||||
@@ -384,7 +384,7 @@ class storyModel extends model
|
||||
}
|
||||
|
||||
/* 获得某一个项目相关的所有需求列表。*/
|
||||
public function getProjectStories($projectID = 0, $orderBy='id|desc', $pager = null)
|
||||
public function getProjectStories($projectID = 0, $orderBy='iddesc', $pager = null)
|
||||
{
|
||||
return $this->dao->select('t1.*, t2.*')->from(TABLE_PROJECTSTORY)->alias('t1')
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
|
||||
@@ -409,7 +409,7 @@ class storyModel extends model
|
||||
}
|
||||
|
||||
/* 获得某一个产品计划下面所有的需求列表。*/
|
||||
public function getPlanStories($planID, $status = 'all', $orderBy = 'id|desc', $pager = null)
|
||||
public function getPlanStories($planID, $status = 'all', $orderBy = 'iddesc', $pager = null)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_STORY)
|
||||
->where('plan')->eq((int)$planID)
|
||||
@@ -418,13 +418,13 @@ class storyModel extends model
|
||||
}
|
||||
|
||||
/* 获得某一个产品计划下面所有的需求列表。*/
|
||||
public function getPlanStoryPairs($planID, $status = 'all', $orderBy = 'id|desc', $pager = null)
|
||||
public function getPlanStoryPairs($planID, $status = 'all', $orderBy = 'iddesc', $pager = null)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_STORY)->where('plan')->eq($planID)->onCaseOf($status != 'all')->andWhere('status')->in($status)->endCase()->fetchAll();
|
||||
}
|
||||
|
||||
/* 获得指派给某一个用户的需求列表。*/
|
||||
public function getUserStories($account, $status = 'all', $orderBy = 'id|desc', $pager = null)
|
||||
public function getUserStories($account, $status = 'all', $orderBy = 'iddesc', $pager = null)
|
||||
{
|
||||
return $this->dao->select('t1.*, t2.title as planTitle, t3.name as productTitle')
|
||||
->from(TABLE_STORY)->alias('t1')
|
||||
|
||||
@@ -113,7 +113,7 @@ class taskModel extends model
|
||||
}
|
||||
|
||||
/* 获得某一个项目的任务列表。*/
|
||||
public function getProjectTasks($projectID, $orderBy = 'status|asc, id|desc', $pager = null)
|
||||
public function getProjectTasks($projectID, $orderBy = 'statusasc, iddesc', $pager = null)
|
||||
{
|
||||
$orderBy = str_replace('status', 'statusCustom', $orderBy);
|
||||
$tasks = $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t3.realname AS ownerRealName')
|
||||
@@ -131,7 +131,7 @@ class taskModel extends model
|
||||
}
|
||||
|
||||
/* 获得某一个项目的任务id=>name列表。*/
|
||||
public function getProjectTaskPairs($projectID, $orderBy = 'id|desc')
|
||||
public function getProjectTaskPairs($projectID, $orderBy = 'iddesc')
|
||||
{
|
||||
$tasks = array('' => '');
|
||||
$stmt = $this->dao->select('t1.id, t1.name, t2.realname AS ownerRealName')
|
||||
|
||||
@@ -42,7 +42,7 @@ class testcase extends control
|
||||
}
|
||||
|
||||
/* 浏览一个产品下面的case。*/
|
||||
public function browse($productID = 0, $browseType = 'byModule', $param = 0, $orderBy = 'id|desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
public function browse($productID = 0, $browseType = 'byModule', $param = 0, $orderBy = 'iddesc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
/* 构造搜索表单。*/
|
||||
$this->config->testcase->search['actionURL'] = $this->createLink('testcase', 'browse', "productID=$productID&browseType=bySearch");
|
||||
|
||||
@@ -68,7 +68,7 @@ class testcaseModel extends model
|
||||
}
|
||||
|
||||
/* 获得某一个产品,某一个模块下面的所有case。*/
|
||||
public function getModuleCases($productID, $moduleIds = 0, $orderBy = 'id|desc', $pager = null)
|
||||
public function getModuleCases($productID, $moduleIds = 0, $orderBy = 'iddesc', $pager = null)
|
||||
{
|
||||
$sql = $this->dao->select('*')->from(TABLE_CASE)->where('product')->eq((int)$productID);
|
||||
if(!empty($moduleIds)) $sql->andWhere('module')->in($moduleIds);
|
||||
|
||||
@@ -40,7 +40,7 @@ class testtask extends control
|
||||
}
|
||||
|
||||
/* 浏览一个产品下面的task。*/
|
||||
public function browse($productID = 0, $orderBy = 'id|desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
public function browse($productID = 0, $orderBy = 'iddesc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
/* 设置产品和菜单。*/
|
||||
$productID = common::saveProductState($productID, key($this->products));
|
||||
|
||||
@@ -48,7 +48,7 @@ class testtaskModel extends model
|
||||
}
|
||||
|
||||
/* 获得某一个产品的测试任务列表。*/
|
||||
public function getProductTasks($productID, $orderBy = 'id|desc', $pager = null)
|
||||
public function getProductTasks($productID, $orderBy = 'iddesc', $pager = null)
|
||||
{
|
||||
return $this->dao->select('t1.*, t2.name AS productName, t3.name AS projectName, t4.name AS buildName')->from(TABLE_TESTTASK)->alias('t1')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
|
||||
|
||||
Reference in New Issue
Block a user