order->is_virtual) { return false; } return true; } protected function _getAmount() { //去掉重复的OrderGoods $uniqueOrderGoods = $this->order->orderGoods->unique('goods_id'); //这里还需要优化,需要更进一步在订单商品里实现每个商品对应的运费计算返回金额 $templateFreight = new TemplateFreight($this->order); $unifyFreight = new UnifyFreight($this->order); return max($templateFreight->getAmount() + $unifyFreight->getAmount(),0); } }