title = "orders/transportLoaded" url = "/orders/transport/loaded/:orderId/:transportId?" layout = "platform_main" is_hidden = 0 [loadTransport] == param("orderId"); $this["transportId"] = $this->param("transportId"); $orderId = $this->param("orderId"); $this["order"] = Romanah\Gokbakja\Models\Order::where("id", $orderId)->with(["client", "shipping"]) ->withCount(['order_items as order_all_amount' => function($query) { $query->select(DB::raw('sum(amount)')); }]) ->withCount(['order_items as order_all_price' => function($query) { $query->select(DB::raw('sum(price)')); }]) ->first(); $this["orderItems"] = Romanah\Gokbakja\Models\OrderItem::where("order_id", $orderId)->orderBy('id', 'DESC')->get(); $this["loadedItems"] = Romanah\Gokbakja\Models\LoadTransport::where("order_id", $orderId)->where("transport_id", $this["transportId"])->with("order_item")->orderBy("id", "DESC")->get(); $this["transport"] = Romanah\Gokbakja\Models\ShippingTransport::where("id", $this["transportId"] )->first(); $this["loadedItemsSum"] = Romanah\Gokbakja\Models\LoadTransport::where("order_id", $orderId)->where("transport_id", $this["transportId"])->with("order_item")->sum("loaded_amount"); } ?> == {% put styles %} {% endput %}