本文整理汇总了PHP中District::get_list方法的典型用法代码示例。如果您正苦于以下问题:PHP District::get_list方法的具体用法?PHP District::get_list怎么用?PHP District::get_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类District
的用法示例。
在下文中一共展示了District::get_list方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_fees
static function get_fees($pid = null) {
$fees = unserialize(self::get_key('fees'));
if (empty($fees) || !is_array($fees)) {
return null;
}
$list_city = City::get_list(true);
$list_district = District::get_list(true, $pid);
$list_fee = array();
if (!empty($fees)) {
foreach ($fees as $did => $fee) {
if (!empty($list_district[$did])) {
$fee['city'] = $list_city[$fee['cid']];
$fee['district'] = $list_district[$did];
$fee['delivery_fee_formatted'] = EClassApi::numberFormat($fee['delivery_fee']);
$fee['min_order_formatted'] = EClassApi::numberFormat($fee['min_order']);
$fee['min_order_fee_formatted'] = EClassApi::numberFormat($fee['min_order_fee']);
$fee['free_delivery_formatted'] = EClassApi::numberFormat($fee['free_delivery']);
$list_fee[$did] = $fee;
}
}
}
return $list_fee;
}
示例2: get_list_address
static function get_list_address($uid)
{
$cities = City::get_list(true);
$districts = District::get_list(true);
$list_address = array();
$select = 'SELECT * FROM delivery_address WHERE uid = ' . $uid;
$query = DB::query($select);
while ($row = mysql_fetch_assoc($query)) {
if (!empty($row['did']) && isset($districts[$row['did']])) {
$district = $districts[$row['did']];
$row['district_name_en'] = $district['name_en'];
$row['district_name'] = $district['name_en'];
if (!empty($district['pid'])) {
$city = $cities[$district['pid']];
$row['city_name_en'] = $city['name_en'];
$row['city_name'] = $city['name_en'];
}
$list_address[] = $row;
}
}
mysql_free_result($query);
return $list_address;
}