You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.6 KiB

3 years ago
<?php
defined('BASE_PATH') OR exit('No direct script access allowed');
class flat
{
/*------------------------------------------------------ */
//-- PUBLIC ATTRIBUTEs
/*------------------------------------------------------ */
/**
* 配置信息
*/
var $configure;
/*------------------------------------------------------ */
//-- PUBLIC METHODs
/*------------------------------------------------------ */
/**
* 构造函数
*
* @param: $configure[array] 配送方式的参数的数组
*
* @return null
*/
function flat($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;
}
}