本文整理匯總了PHP中CGlobal::provinces方法的典型用法代碼示例。如果您正苦於以下問題:PHP CGlobal::provinces方法的具體用法?PHP CGlobal::provinces怎麽用?PHP CGlobal::provinces使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CGlobal
的用法示例。
在下文中一共展示了CGlobal::provinces方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getProvinces
static function getProvinces($update_cache = 0, $delcache = false)
{
if (!CGlobal::$provinces || $delcache || $update_cache) {
if (AZArrCache::is_not_cached('provinces_arr', 0, '', $delcache)) {
if (!$delcache) {
$re = DB::query('SELECT id, name, brief_name, status, area FROM province ORDER BY position', __LINE__ . __FILE__);
$topProvinces = array();
$ortherProvinces = array();
if ($re) {
while ($province = mysql_fetch_assoc($re)) {
$province['ebname'] = AZLib::safe_title($province['name']);
if ($province['status'] == "HOME") {
$topProvinces[$province['id']] = $province;
} else {
$ortherProvinces[$province['id']] = $province;
}
}
}
$topProvinces[0] = array('id' => 0, 'name' => 'Toàn quốc', 'brief_name' => 'Toàn quốc', 'status' => 'SHOW', 'area' => '1', 'ebname' => 'Toan-Quoc');
CGlobal::$provinces = $topProvinces + $ortherProvinces;
AZArrCache::set(CGlobal::$provinces);
} else {
foreach (CGlobal::$my_server as $server) {
//Tạo lại file js cho city
@fopen("http://{$server}/citygen.php", "r");
}
$js_ver = rand(1, 1000);
AZMemcache::do_put("city_ver:", $js_ver);
}
} else {
CGlobal::$provinces = AZArrCache::$arr_cache;
AZArrCache::$arr_cache = array();
}
}
}