本文整理汇总了PHP中Rank::find_by_translated方法的典型用法代码示例。如果您正苦于以下问题:PHP Rank::find_by_translated方法的具体用法?PHP Rank::find_by_translated怎么用?PHP Rank::find_by_translated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rank
的用法示例。
在下文中一共展示了Rank::find_by_translated方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_stats_for_family
private function get_stats_for_family($taxon_concept_id)
{
$query = "SELECT COUNT(DISTINCT he_children.taxon_concept_id) as count\n FROM hierarchy_entries he\n JOIN hierarchy_entries_flattened hef on (he.id=hef.ancestor_id)\n JOIN hierarchy_entries he_children on (hef.hierarchy_entry_id=he_children.id)\n JOIN taxon_concepts tc on (he_children.taxon_concept_id=tc.id)\n JOIN hierarchies h on (he_children.hierarchy_id=h.id)\n LEFT JOIN taxon_concept_metrics tcm ON (he_children.taxon_concept_id=tcm.taxon_concept_id)\n WHERE he.taxon_concept_id={$taxon_concept_id}\n AND he.published=1\n AND tc.published=1\n AND tc.supercedure_id=0\n AND he.visibility_id=" . Visibility::visible()->id . "\n AND he_children.rank_id IN (" . Rank::find_by_translated('label', 'sp.')->id . ", " . Rank::find_by_translated('label', 'species')->id . ")\n AND tcm.richness_score >= .4";
$count_of_rich_species = $this->mysqli->select_value($query);
$media_counts = TaxonConcept::media_counts($taxon_concept_id);
$all_media_count = @$media_counts['image'] + @$media_counts['video'] + @$media_counts['sound'];
return array('NumberRichSpeciesPagesInEOL' => $count_of_rich_species, 'NumberImagesInEOL' => @$media_counts['image'], 'NumberArticlesInEOL' => @$media_counts['text'], 'NumberMediaInEOL' => $all_media_count, 'RichPageOnEOL' => $count_of_rich_species >= 0 ? 'http://eol.org/schema/terms/yes' : 'http://eol.org/schema/terms/no');
}