\app\common\service\deliveryExpress

快递配送服务类 Class Delivery

Summary

Methods
Properties
Constants
__construct()
getNotInRuleGoods()
setExpressPrice()
getTotalFreight()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
onCalcGoodsfreight()
isFullFree()
getCityDeliveryRule()
freightRule()
$wxappId
$cityId
$goodsList
$orderType
N/A

Properties

$wxappId

$wxappId : 

Type

$cityId

$cityId : 

Type

$goodsList

$goodsList : 

Type

$orderType

$orderType : 

Type

Methods

__construct()

__construct(integer  $wxappId, integer  $cityId, array  $goodsList, integer  $orderType = \app\common\enum\OrderType::MASTER) 

配送服务类构造方法 Delivery constructor.

Parameters

integer $wxappId

小程序商城id

integer $cityId

用户收货城市id

array $goodsList

订单商品列表

integer $orderType

订单商品列表

getNotInRuleGoods()

getNotInRuleGoods() : boolean

根据用户收货城市id 验证是否在商品配送规则中 如果不存在则返回该商品,如果存在返回false

Returns

boolean

setExpressPrice()

setExpressPrice() : boolean

设置订单商品的运费

Returns

boolean

getTotalFreight()

getTotalFreight() : double

获取订单最终运费

Returns

double

onCalcGoodsfreight()

onCalcGoodsfreight(integer  $goods, double  $orderTotalPrice) : double

计算商品的配送费用

Parameters

integer $goods

商品id

double $orderTotalPrice

订单总金额

Returns

double

isFullFree()

isFullFree(integer  $goodsId, double  $orderTotalPrice) : boolean

判断是否满足满额包邮条件

Parameters

integer $goodsId

商品id

double $orderTotalPrice

订单总金额

Returns

boolean

getCityDeliveryRule()

getCityDeliveryRule(  $goods) : array|false

根据城市id获取规则信息

Parameters

$goods

Returns

array|false

freightRule()

freightRule(array  $expressPriceArr) : double

根据运费组合策略 计算最终运费

Parameters

array $expressPriceArr

全部商品运费

Returns

double