本文整理汇总了PHP中ProjectMilestones::info_cache方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectMilestones::info_cache方法的具体用法?PHP ProjectMilestones::info_cache怎么用?PHP ProjectMilestones::info_cache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectMilestones
的用法示例。
在下文中一共展示了ProjectMilestones::info_cache方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMilestonesInfo
static function getMilestonesInfo($mid)
{
if (self::$info_cache == null) {
self::$info_cache = array();
// completed
$rows = DB::executeAll("select count(object_id) as row_count, milestone_id from " . TABLE_PREFIX . "project_tasks use index (completed_on) where completed_on > '0000-00-00' group by milestone_id;");
if (is_array($rows)) {
foreach ($rows as $row) {
if (array_var($row, 'milestone_id') > 0) {
if (!isset(self::$info_cache[$row['milestone_id']])) {
self::$info_cache[$row['milestone_id']] = array();
}
self::$info_cache[$row['milestone_id']]['tc'] = array_var($row, 'row_count');
}
}
}
// all milestone tasks
$rows = DB::executeAll("select count(object_id) as row_count, milestone_id from " . TABLE_PREFIX . "project_tasks use index (milestone_id) group by milestone_id;");
if (is_array($rows)) {
foreach ($rows as $row) {
if (array_var($row, 'milestone_id') > 0) {
if (!isset(self::$info_cache[$row['milestone_id']])) {
self::$info_cache[$row['milestone_id']] = array();
}
self::$info_cache[$row['milestone_id']]['tnum'] = array_var($row, 'row_count');
}
}
}
}
return array_var(self::$info_cache, $mid);
}