setOrder($order); } } /** * 获取原价 * @return int */ public function getGoodsPrice() { return $this->sum(function (PreOrderGoods $orderGoods) { return $orderGoods->getGoodsPrice(); }); } /** * 获取成交价 * @return int */ public function getPrice() { return $this->sum(function (PreOrderGoods $orderGoods) { return $orderGoods->getPrice(); }); } /** * 获取会员价 * @return int */ public function getVipPrice() { return $this->sum(function (PreOrderGoods $orderGoods) { return $orderGoods->getVipPrice(); }); } /** * 获取支付价 * @return int */ public function getPaymentAmount() { return $this->sum(function (PreOrderGoods $orderGoods) { return $orderGoods->getPaymentAmount(); }); } /** * 获取折扣优惠券优惠金额 * @return int */ public function getCouponDiscountPrice() { return $this->sum(function ($orderGoods) { return $orderGoods->couponDiscountPrice; }); } /** * 订单商品集合中包含虚拟物品 * @return bool true 包含 false 不包含 */ public function hasVirtual(){ $bool = $this->contains(function ($aOrderGoods) { // 包含虚拟商品 //return $aOrderGoods->goods->type == 2; //todo 20190107 blank 修改 :包含实体商品按实体商品下单流程走 return $aOrderGoods->goods->type == 1; }); return !$bool; } /** * 订单商品集合中包含不需要地址的物品 * @return bool true 不需要 false 需要 */ public function hasNeedAddress() { $bool = $this->contains(function ($aOrderGoods) { // 包含不需要地址的商品 //return $aOrderGoods->goods->need_address == 1; //todo 20190107 blank 修改 :包含需要地址的商品按标准下单流程走 return $aOrderGoods->goods->need_address != 1; }); return !$bool; } }