join('link', function (JoinClause $join): void { $join->on('l_from', '=', 'i_id'); $join->on('l_file', '=', 'i_file'); }) ->where('l_type', '=', 'NOTE') ->where('l_file', '=', $tree->id()) ->groupBy('l_to') ->select(['l_to', DB::raw('COUNT(*) AS total')]) ->pluck('total', 'l_to') ->all(); $count_individuals = DB::table('families') ->join('link', function (JoinClause $join): void { $join->on('l_from', '=', 'f_id'); $join->on('l_file', '=', 'f_file'); }) ->where('l_type', '=', 'NOTE') ->where('l_file', '=', $tree->id()) ->groupBy('l_to') ->select(['l_to', DB::raw('COUNT(*) AS total')]) ->pluck('total', 'l_to') ->all(); $count_media = DB::table('media') ->join('link', function (JoinClause $join): void { $join->on('l_from', '=', 'm_id'); $join->on('l_file', '=', 'm_file'); }) ->where('l_type', '=', 'NOTE') ->where('l_file', '=', $tree->id()) ->groupBy('l_to') ->select(['l_to', DB::raw('COUNT(*) AS total')]) ->pluck('total', 'l_to') ->all(); $count_sources = DB::table('sources') ->join('link', function (JoinClause $join): void { $join->on('l_from', '=', 's_id'); $join->on('l_file', '=', 's_file'); }) ->where('l_type', '=', 'NOTE') ->where('l_file', '=', $tree->id()) ->groupBy('l_to') ->select(['l_to', DB::raw('COUNT(*) AS total')]) ->pluck('total', 'l_to') ->all(); ?>
= I18N::translate('Title') ?> | = I18N::translate('Individuals') ?> | = I18N::translate('Families') ?> | = I18N::translate('Media objects') ?> | = I18N::translate('Sources') ?> | = I18N::translate('Last change') ?> |
---|---|---|---|---|---|
= $note->getFullName() ?> | = I18N::number($count_individuals[$note->xref()] ?? 0) ?> | = I18N::number($count_families[$note->xref()] ?? 0) ?> | = I18N::number($count_media[$note->xref()] ?? 0) ?> | = I18N::number($count_sources[$note->xref()] ?? 0) ?> | = $note->lastChangeTimestamp() ?> |