当前位置: 首页>>代码示例>>PHP>>正文


PHP District::get_list方法代码示例

本文整理汇总了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;
    }
开发者ID:hqd276,项目名称:bigs,代码行数:26,代码来源:SiteConfig.php

示例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;
 }
开发者ID:hqd276,项目名称:bigs,代码行数:23,代码来源:PersonalDB.php


注:本文中的District::get_list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。