Skip to content

Instantly share code, notes, and snippets.

@dodyw
Created September 27, 2011 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dodyw/1246498 to your computer and use it in GitHub Desktop.
Save dodyw/1246498 to your computer and use it in GitHub Desktop.
indexu bug fix #18 Links Count Bug
function cat_build_stat($category_id) {
global $lep;
$children = cat_get_children($category_id);
$children[] = $category_id;
$children_str = implode(', ',$children);
$query = "select count(res_id) from lep_resource where category_id in ($children_str) and suspended = 0 and status = 1";
$num_res = $lep->db->GetOne($query);
$query = "update lep_category set num_res = '$num_res' where category_id = '$category_id'";
$rs = $lep->db->Execute($query);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment