From ab57b31bb4d7ebcd191507268dfe433e8c9a0248 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Tue, 3 Nov 2020 14:48:50 +0800 Subject: [PATCH] *Fix bug. --- module/block/control.php | 5 ++++- module/durationestimation/model.php | 2 +- module/program/model.php | 9 +-------- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/module/block/control.php b/module/block/control.php index f5a46af874..968d447c09 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -1735,7 +1735,10 @@ class block extends control */ public function printRecentprogramBlock() { - $this->view->programs = $this->loadModel('program')->getProgramStats('all', 3, 'order_desc'); + /* load pager. */ + $this->app->loadClass('pager', $static = true); + $pager = new pager(0, 3, 1); + $this->view->programs = $this->loadModel('program')->getProgramStats('all', 30, 'id_desc', $pager); } public function printProgramteamBlock() diff --git a/module/durationestimation/model.php b/module/durationestimation/model.php index a3b3b908f0..c43322f495 100644 --- a/module/durationestimation/model.php +++ b/module/durationestimation/model.php @@ -22,7 +22,7 @@ class durationestimationModel extends model foreach($this->post->stage as $i => $stage) { $estimation = new stdclass; - $estimation->program = $program; + $estimation->PRJ = $program; $estimation->stage = $stage; $estimation->workload = $this->post->workload[$i]; $estimation->worktimeRate = $this->post->worktimeRate[$i]; diff --git a/module/program/model.php b/module/program/model.php index 5c6086e734..f10510900e 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -122,17 +122,10 @@ class programModel extends model { /* Init vars. */ $this->loadModel('project'); - $programs = $this->getPRJList(0, $status, $orderBy, $pager); - + $programs = $this->getPRJList(0, $status, 0, $orderBy, $pager); if(empty($programs)) return array(); $programIdList = array_keys($programs); - $programs = $this->dao->select('*')->from(TABLE_PROGRAM) - ->where('id')->in($programIdList) - ->orderBy($orderBy) - ->limit($itemCounts) - ->fetchAll('id'); - $teams = $this->dao->select('root, count(*) as count')->from(TABLE_TEAM) ->where('root')->in($programIdList) ->groupBy('root')