本文整理匯總了PHP中Rank::species_ranks_ids方法的典型用法代碼示例。如果您正苦於以下問題:PHP Rank::species_ranks_ids方法的具體用法?PHP Rank::species_ranks_ids怎麽用?PHP Rank::species_ranks_ids使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Rank
的用法示例。
在下文中一共展示了Rank::species_ranks_ids方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: end_load_data
function end_load_data()
{
echo "removing data files\n";
unlink(DOC_ROOT . "temp/top_images.sql");
unlink(DOC_ROOT . "temp/top_unpublished_images.sql");
// swap temporary tables with real tables
$result = $this->mysqli->query("SELECT 1 FROM top_images_tmp LIMIT 1");
if ($result && ($row = $result->fetch_assoc())) {
$this->mysqli->update("RENAME TABLE top_images TO top_images_swap,\r\n top_images_tmp TO top_images,\r\n top_images_swap TO top_images_tmp");
}
$result = $this->mysqli->query("SELECT 1 FROM top_unpublished_images_tmp LIMIT 1");
if ($result && ($row = $result->fetch_assoc())) {
$this->mysqli->update("RENAME TABLE top_unpublished_images TO top_unpublished_images_swap,\r\n top_unpublished_images_tmp TO top_unpublished_images,\r\n top_unpublished_images_swap TO top_unpublished_images_tmp");
}
$species_rank_ids = implode(",", Rank::species_ranks_ids());
// maybe also add where lft=rgt-1??
echo "top_species_images\n";
$this->mysqli->delete("DELETE FROM top_species_images");
$this->mysqli->update("INSERT INTO top_species_images (SELECT ti.* FROM hierarchy_entries he JOIN top_images ti ON (he.id=ti.hierarchy_entry_id) WHERE he.rank_id IN ({$species_rank_ids}))");
echo "top_unpublished_species_images\n";
$this->mysqli->delete("DELETE FROM top_unpublished_species_images");
$this->mysqli->update("INSERT INTO top_unpublished_species_images (SELECT tui.* FROM hierarchy_entries he JOIN top_unpublished_images tui ON (he.id=tui.hierarchy_entry_id) WHERE he.rank_id IN ({$species_rank_ids}))");
$this->mysqli->end_transaction();
}