From 5bf7ad754b331e6a04ba2108acdb16362f71b277 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Thu, 5 Nov 2009 07:14:19 +0000 Subject: [PATCH] * show doing project only in index page. --- trunk/module/index/control.php | 2 +- trunk/module/project/model.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/trunk/module/index/control.php b/trunk/module/index/control.php index ed62a7dfdd..d63150849a 100644 --- a/trunk/module/index/control.php +++ b/trunk/module/index/control.php @@ -38,7 +38,7 @@ class index extends control $this->loadModel('report'); $header['title'] = $this->lang->index->common; - $projects = $this->project->getList(); + $projects = $this->project->getList('doing'); $products = array_values($this->product->getList()); foreach($projects as $project) diff --git a/trunk/module/project/model.php b/trunk/module/project/model.php index 564332717e..bd2f5db94d 100644 --- a/trunk/module/project/model.php +++ b/trunk/module/project/model.php @@ -91,9 +91,11 @@ class projectModel extends model } /* 获得完整的列表。*/ - public function getList() + public function getList($status = 'all') { - return $this->dao->select('*')->from(TABLE_PROJECT)->where('iscat')->eq(0)->andwhere('company')->eq($this->app->company->id)->orderBy('status, end|desc')->fetchAll(); + $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(); } /* 通过Id获取项目信息。*/