| @@ 665-676 (lines=12) @@ | ||
| 662 | if (!is_null($id)) { |
|
| 663 | /* @var $Product \Eccube\Entity\Product */ |
|
| 664 | $Product = $this->productRepository->find($id); |
|
| 665 | if (!$Product) { |
|
| 666 | if ($request->isXmlHttpRequest()) { |
|
| 667 | $message = trans('admin.delete.warning'); |
|
| 668 | ||
| 669 | return $this->json(['success' => $success, 'message' => $message]); |
|
| 670 | } else { |
|
| 671 | $this->deleteMessage(); |
|
| 672 | $rUrl = $this->generateUrl('admin_product_page', ['page_no' => $page_no]).'?resume='.Constant::ENABLED; |
|
| 673 | ||
| 674 | return $this->redirect($rUrl); |
|
| 675 | } |
|
| 676 | } |
|
| 677 | ||
| 678 | if ($Product instanceof Product) { |
|
| 679 | log_info('商品削除開始', [$id]); |
|
| @@ 726-738 (lines=13) @@ | ||
| 723 | $message = trans('admin.delete.failed'); |
|
| 724 | } |
|
| 725 | ||
| 726 | if ($request->isXmlHttpRequest()) { |
|
| 727 | return $this->json(['success' => $success, 'message' => $message]); |
|
| 728 | } else { |
|
| 729 | if ($success) { |
|
| 730 | $this->addSuccess($message, 'admin'); |
|
| 731 | } else { |
|
| 732 | $this->addError($message, 'admin'); |
|
| 733 | } |
|
| 734 | ||
| 735 | $rUrl = $this->generateUrl('admin_product_page', ['page_no' => $page_no]).'?resume='.Constant::ENABLED; |
|
| 736 | ||
| 737 | return $this->redirect($rUrl); |
|
| 738 | } |
|
| 739 | } |
|
| 740 | ||
| 741 | /** |
|