'base_fee', 'value' => 10), ); /* 模式编辑器 */ $modules[$i]['print_model'] = 2; /* 打印单背景 */ $modules[$i]['print_bg'] = ''; /* 打印快递单标签位置信息 */ $modules[$i]['config_lable'] = ''; return; } class flat { /*------------------------------------------------------ */ //-- PUBLIC ATTRIBUTEs /*------------------------------------------------------ */ /** * 配置信息 */ var $configure; /*------------------------------------------------------ */ //-- PUBLIC METHODs /*------------------------------------------------------ */ /** * 构造函数 * * @param: $configure[array] 配送方式的参数的数组 * * @return null */ function __construct($cfg = array()) { foreach ($cfg AS $key => $val) { $this->configure[$val['name']] = $val['value']; } } /** * 计算订单的配送费用的函数 * * @param float $goods_weight 商品重量 * @param float $goods_amount 商品金额 * @return decimal */ function calculate($goods_weight, $goods_amount) { if ($this->configure['free_money'] > 0 && $goods_amount >= $this->configure['free_money']) { return 0; } else { return isset($this->configure['base_fee']) ? $this->configure['base_fee'] : 0; } } /** * 查询发货状态 * 该配送方式不支持查询发货状态 * * @access public * @param string $invoice_sn 发货单号 * @return string */ function query($invoice_sn) { return $invoice_sn; } function getorder($order){ $kuaidi = sprintf($GLOBALS['_CFG']['kuaidi100'],'flat',$order); $result = getcontent($kuaidi); $getdata = json_decode($result,true); if($getdata['message']!='ok'){ $data['data'][0] = array('time'=> local_date('Y-m-d H:m:s', gmtime()),'context'=>'请联系客服查询!'); }else{ $data = json_decode($result,true); } return $data; } } ?>