/** * подробный список услуг в заказе * * @param $id * * @return \Illuminate\View\View */ public function orderServices($id) { try { $os = new OrderServiceComponent(); $services = $os->parseOrderService($id); $showButton = true; if (PaymentCloud::checkPaid($id)) { $showButton = false; } $total = 0; foreach ($services as $service) { $total += $service['amount']; } // если не русский, будем переводить if (App::getLocale() != 'ru') { foreach ($services as &$item) { $title = ServiceTitle::whereName($item['name'])->first(); if ($title) { $item['name'] = $title->lang(App::getLocale()); } } } } catch (ApiException $e) { return $this->responseException($e, true); } return View::make('ac::order', ['services' => $services, 'id' => $id, 'showButton' => $showButton, 'total' => $total]); }