diff --git a/module/bug/control.php b/module/bug/control.php index c1d69bf687..e23f14f4f0 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -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); diff --git a/module/bug/model.php b/module/bug/model.php index 05dbad43bf..6f657ebbca 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -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(); } diff --git a/module/common/control.php b/module/common/control.php index 4073ed9dde..30132a1d13 100644 --- a/module/common/control.php +++ b/module/common/control.php @@ -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); diff --git a/module/product/control.php b/module/product/control.php index 94e7c8db9e..11caa949ee 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -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"); diff --git a/module/project/control.php b/module/project/control.php index 1eec9b3e7a..51d1c276d3 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -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'); diff --git a/module/project/model.php b/module/project/model.php index d3653ea519..4b49a89aaa 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -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); /* 如果没有记录,手工补齐。*/ diff --git a/module/story/model.php b/module/story/model.php index 585737aa3b..ff98f6b4ad 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -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') diff --git a/module/task/model.php b/module/task/model.php index 8bda2038ad..350820577d 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -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') diff --git a/module/testcase/control.php b/module/testcase/control.php index 515a539393..2809d63927 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -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"); diff --git a/module/testcase/model.php b/module/testcase/model.php index 880796c8b3..827265078a 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -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); diff --git a/module/testtask/control.php b/module/testtask/control.php index 5cb08fd202..c09a977e40 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -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)); diff --git a/module/testtask/model.php b/module/testtask/model.php index 6559306a07..92fdea49af 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -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')