private function _count($projectid, $verid = 0, $moduleid = 0) { $bugCfg = qp_sys::config('bugconfig'); $where = 'projectid=' . $projectid; if ($verid > 0) { $where .= ' and verid=' . $verid; } if ($moduleid > 0) { $where .= ' and moduleid=' . $moduleid; } // 统计类型 $countType = array(1 => array('name' => L('bug.bugtype'), 'item' => 'bugtype'), 2 => array('name' => L('bug.to_user'), 'item' => ''), 3 => array('name' => L('bug.creater'), 'item' => ''), 4 => array('name' => L('bug.status'), 'item' => 'status'), 5 => array('name' => L('bug.severity'), 'item' => 'severity'), 6 => array('name' => L('bug.priority'), 'item' => 'priority')); // 查询所有的统计类型 $result = array(); foreach ($countType as $type => $items) { $row = array('title' => $items['name'], 'lists' => array()); // 如果是BUG的属性 if ($items['item'] != '') { $field = $items['item']; foreach ($bugCfg[$field] as $key => $name) { $row['lists'][$name] = $this->db->count($this->bugTable, $where . " and {$field}=" . $key); } } else { switch ($type) { // 缺陷分配 case 2: // 得到所分配的所有用户 $sql = "select DISTINCT touserid from " . $this->bugTable . " where {$where}"; $touserArr = $this->db->fetchCol($sql); foreach ($touserArr as $userid) { // 得到用户名 $username = User::getInfo($userid, 'username'); $row['lists'][$username] = $this->db->count($this->bugTable, $where . ' and touserid=' . $userid); } break; // 缺陷创建 // 缺陷创建 case 3: // 得到所分配的所有用户 $sql = "select DISTINCT createuid from " . $this->bugTable . " where {$where}"; $touserArr = $this->db->fetchCol($sql); foreach ($touserArr as $userid) { // 得到用户名 $username = User::getInfo($userid, 'username'); $row['lists'][$username] = $this->db->count($this->bugTable, $where . ' and createuid=' . $userid); } break; } // end switch } // end if $result[] = $row; } // end foreach return $result; }
</tr> <tr style="display:none" id="qp_tr_includepath"> <td colspan="2"><?php qp_sys::dump(explode(PATH_SEPARATOR, get_include_path())); ?> </td> </tr> <tr class="tr_click" onclick="qp_debug_swap_show('qp_tr_includefile')"> <td colspan="2">[引入文件]</td> </tr> <tr style="display:none" id="qp_tr_includefile"> <td colspan="2"><?php qp_sys::dump(get_included_files()); ?> </td> </tr> <tr class="tr_click" onclick="qp_debug_swap_show('qp_tr_extensions')"> <td colspan="2">[安装的扩展]</td> </tr> <tr style="display:none" id="qp_tr_extensions"> <td colspan="2"><?php qp_sys::dump(get_loaded_extensions()); ?> </td> </tr> </table>