$val) { $this->configure[$val['name']] = $val['value']; } } /** * 计算订单的配送费用的函数 * * @param float $goods_weight 商品重量 * @param float $goods_amount 商品金额 * @param float $goods_number 商品件数 * @return decimal */ function calculate($goods_weight, $goods_amount, $goods_number) { if ($this->configure['free_money'] > 0 && $goods_amount >= $this->configure['free_money']) { return 0; } else { $fee = $this->configure['base_fee']; $this->configure['fee_compute_mode'] = !empty($this->configure['fee_compute_mode']) ? $this->configure['fee_compute_mode'] : 'by_weight'; if ($this->configure['fee_compute_mode'] == 'by_number') { $fee = $goods_number * $this->configure['item_fee']; } else { if ($goods_weight > 0.5) { $fee += (ceil(($goods_weight - 0.5) / 0.5)) * $this->configure['step_fee']; } } return $fee; } } /** * 查询发货状态 * * @access public * @param string $invoice_sn 发货单号 * @return string */ function query($invoice_sn) { $str = '订单跟踪'; return $str; } } ?>