public function idealPredict(Invoice $invoice) { $ideal = 0; foreach ($invoice->getOrders() as $order) { if ($order->getFits()) { continue; } $ideal += $this->ruleHelper->getPredict($order); } return $ideal; }
public function buildAllPayInfo(Invoice $invoice, array &$items, &$price) { foreach ($invoice->getOrders() as $order) { $product = $order->getGoodsPassport(); $item = $product->genItem(); $item['Price'] = $order->getRequired(); $items[] = $item; // 增加訂單總金額 $price += $order->getRequired(); } return $this; }