From f90a9dbe3d27d6f26596636370a331dbb910591f Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Fri, 20 Nov 2020 11:23:46 +0800 Subject: [PATCH] * Variable renaming 'project' to 'execution'. --- module/block/control.php | 10 +++++----- module/block/model.php | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/module/block/control.php b/module/block/control.php index b060ec7bce..fafaa7dd62 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -302,11 +302,11 @@ class block extends control $data = $this->block->getWelcomeBlockData(); - $this->view->tasks = $data['tasks']; - $this->view->doneTasks = $data['doneTasks']; - $this->view->bugs = $data['bugs']; - $this->view->stories = $data['stories']; - $this->view->projects = $data['projects']; + $this->view->tasks = $data['tasks']; + $this->view->doneTasks = $data['doneTasks']; + $this->view->bugs = $data['bugs']; + $this->view->stories = $data['stories']; + $this->view->executions = $data['executions']; $this->view->delay['task'] = $data['delayTask']; $this->view->delay['bug'] = $data['delayBug']; diff --git a/module/block/model.php b/module/block/model.php index 90f06608fb..c483a8379e 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -166,20 +166,20 @@ class blockModel extends model { $data = array(); - $data['tasks'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_TASK)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->fetch('count'); - $data['doneTasks']= (int)$this->dao->select('count(*) AS count')->from(TABLE_TASK)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->andWhere('status')->eq('done')->fetch('count'); - $data['bugs'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_BUG) + $data['tasks'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_TASK)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->fetch('count'); + $data['doneTasks'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_TASK)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->andWhere('status')->eq('done')->fetch('count'); + $data['bugs'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_BUG) ->where('assignedTo')->eq($this->app->user->account) ->beginIF(!$this->app->user->admin)->andWhere('project')->in('0,' . $this->app->user->view->projects)->fi() //Fix bug #2373. ->andWhere('deleted')->eq(0) ->fetch('count'); - $data['stories'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_STORY)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->andWhere('type')->eq('story')->fetch('count'); - $data['projects'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_PROJECT) + $data['stories'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_STORY)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->andWhere('type')->eq('story')->fetch('count'); + $data['executions'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_PROJECT) ->where('status')->notIN('done,closed') ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi() ->andWhere('deleted')->eq(0) ->fetch('count'); - $data['products'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_PRODUCT) + $data['products'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_PRODUCT) ->where('status')->ne('closed') ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->products)->fi() ->andWhere('deleted')->eq(0)