app/Customize/Controller/ItemController.php line 479

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Customize\Controller;
  13. use Customize\Converter\DynamicConverter;
  14. use Customize\Entity\CacheTrait;
  15. use Customize\Service\SearchItemService;
  16. use Customize\Service\RecommendationService;
  17. use Customize\Controller\LM\LmAbstractController;
  18. use Customize\Service\CommonService;
  19. use Customize\Service\GoodsService;
  20. use Customize\Service\LmHelper;
  21. use Lm\Engine\EC\Entity\GoodsWithRelated;
  22. use Lm\Engine\EC\Entity\Item\Item;
  23. use Lm\Entity\Goods;
  24. use Symfony\Component\HttpFoundation\Request;
  25. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  26. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  27. use Lm\Service\Db\SqlService;
  28. use Symfony\Component\Routing\Annotation\Route;
  29. use Customize\Converter\ProductConverter;
  30. use Eccube\Repository\ProductRepository;
  31. use Eccube\Common\EccubeConfig;
  32. use Customize\Service\ReviewService;
  33. use Customize\Service\MessageService;
  34. use Customize\Service\RecentGoodsService;
  35. use Customize\Service\MobileDetector as LmMobileDetector;
  36. class ItemController extends LmAbstractController
  37. {
  38.     use CacheTrait;
  39.     // 同一カテゴリのおすすめ表示数
  40.     const SP_RECOMMEND_ITEM_LIST_COUNT 9;
  41.     const ITEMS_PER_PAGE 30;
  42.     const SP_ITEMS_PER_PAGE 10;
  43.     const MAX_PAGING_LINKS 10;
  44.     const SP_MAX_PAGING_LINKS 4;
  45.     /**
  46.      * @var GoodsService $goodsService
  47.      */
  48.     protected $goodsService;
  49.     /**
  50.      * @var DynamicConverter $dynamicConverter
  51.      */
  52.     protected $dynamicConverter;
  53.     protected $eccubeConfig;
  54.     protected $MessageService;
  55.     /**
  56.      * @var LmMobileDetector
  57.      */
  58.     private $mobileDetector;
  59.     /**
  60.      * @var RecommendationService
  61.      */
  62.     private $recommendationService;
  63.     public function __construct(CommonService     $commonService,
  64.                                 LmHelper          $lmHelper,
  65.                                 GoodsService      $goodsService,
  66.                                 ProductRepository $productRepository,
  67.                                 DynamicConverter  $dynamicConverter,
  68.                                 EccubeConfig      $eccubeConfig,
  69.                                 ReviewService     $ReviewService,
  70.                                 MessageService    $MessageService,
  71.                                 RecentGoodsService $RecentGoodsService,
  72.                                 LmMobileDetector  $mobileDetector,
  73.                                 RecommendationService $recommendationService
  74.     )
  75.     {
  76.         //
  77.         parent::__construct($commonService$lmHelper);
  78.         //
  79.         $this->goodsService $goodsService;
  80.         $this->productRepository $productRepository;
  81.         $this->dynamicConverter $dynamicConverter;
  82.         $this->eccubeConfig $eccubeConfig;
  83.         $this->ReviewService $ReviewService;
  84.         $this->MessageService $MessageService;
  85.         $this->RecentGoodsService $RecentGoodsService;
  86.         $this->mobileDetector $mobileDetector;
  87.         $this->recommendationService $recommendationService;
  88.     }
  89.     /**
  90.      * シークレットプレビュー
  91.      * @Route("/secret-preview-switch", name="secret_preview_switch", methods={"GET", "POST"})
  92.      * @return \Symfony\Component\HttpFoundation\RedirectResponse
  93.      */
  94.     public function secretPreviewSwitch(Request $request)
  95.     {
  96.         //
  97.         $parameters = [
  98.             'id' => $request->get('goods_id'),
  99.         ];
  100.         //
  101.         return $this->redirectToRoute('item/detail'$parameters);
  102.     }
  103.     /**
  104.      * @param Request $request
  105.      * @Route("/item/{id}.html", requirements={"id" = "\S+"}, name="item/detail", methods={"GET"})
  106.      * @Route("/item/{id}/{ct1}.html", requirements={"id" = "\S+", "ct1" = "\S+"}, name="item/detail/ct1", methods={"GET"})
  107.      * @Route("/item/{id}/{ct1}/{ct2}.html", requirements={"id" = "\S+", "ct1" = "\S+", "ct2" = "\S+"}, name="item/detail/ct1/ct2", methods={"GET"})
  108.      * @Route("/item/{id}/{ct1}/{ct2}/{ct3}.html", requirements={"id" = "\S+", "ct1" = "\S+", "ct2" = "\S+", "ct3" = "\S+"}, name="item/detail/ct1/ct2/ct3", methods={"GET"})
  109.      * @Template("Item/detail.twig")
  110.      */
  111.     public function detail(Request $request$_route$id$ct1 null$ct2 null$ct3 null)
  112.     {
  113.         //
  114.         $request->attributes->set('_route''item/detail');
  115.         //
  116.         $params compact('id''ct1''ct2''ct3');
  117.         $queries $request->query->all();
  118.         $params += $queries;
  119.         // 品番URLの相互リダイレクト判定
  120.         if (($canonicalId $this->goodsService->getGoodsRoutingMap($id)) !== false) {
  121.             //
  122.             $params['id'] = $canonicalId;
  123.             //
  124.             return $this->redirectToRoute($_route$params);
  125.         }
  126.         // 商品IDの取得
  127.         if (($mappedGoodsId $this->goodsService->getGoodsRoutingByHinban($id)) !== false) {
  128.             // 品番URL
  129.             $goodsId $mappedGoodsId;
  130.         } elseif (is_numeric($id)) {
  131.             // 通常URL
  132.             $goodsId $id;
  133.         } else {
  134.             // 商品IDが不正
  135.             throw new NotFoundHttpException();
  136.         }
  137.         // 商品IDを記憶
  138.         $goodsId = (int)$goodsId;
  139.         $request->attributes->set('goodsId'$goodsId);
  140.         // バリデーション
  141.         try {
  142.             if (!($goods = new GoodsWithRelated($goodsId))) {
  143.                 // 商品が見つからない
  144.                 throw new NotFoundHttpException('商品が見つかりません');
  145.             } else if (!empty($goods->getGoodsDdate())) {
  146.                 // 商品が削除済み
  147.                 throw new NotFoundHttpException('削除済みの商品です');
  148.             } else if ($goods->getGoodsStatus() === Goods::GOODS_STATUS_UNAVAIABLE){
  149.                 // 非表示商品
  150.                 if (!LmHelper::isSecret()) {
  151.                     // シークレットプレビュー不可
  152.                     throw new NotFoundHttpException('商品を閲覧する権限がありません');
  153.                 }
  154.             }
  155.         } catch (\Exception $e) {
  156.             throw new NotFoundHttpException($e->getMessage(), $e);
  157.         }
  158.         // 複製商品
  159.         $mc null;
  160.         $mcMcWebName null;
  161.         $mcWebName null;
  162.         $ctWebName null;
  163.         if (!empty($ct1) || !empty($ct2) || !empty($ct3)) {
  164.             if (!empty($ct1) && !empty($ct2) && !empty($ct3)) {
  165.                 //
  166.                 if ($mc $this->goodsService->isBelongsToMcMcCt($goodsId$ct1$ct2$ct3)) {
  167.                     // 配下親カテゴリ/親カテゴリ/子カテゴリ
  168.                     // 本番環境: https://www.l-m.co.jp/item/11-8035/work/burtle/aw.html
  169.                     // 検証環境: https://stg.l-m.co.jp/item/11-8035/work/burtle/aw.html
  170.                     // 開発環境: https://eccube.l-m.local/item/11-8035/work/burtle/aw.html
  171.                     $mcMcWebName $ct1;
  172.                     $mcWebName $ct2;
  173.                     $ctWebName $ct3;
  174.                 }
  175.             } else if (!empty($ct1) && !empty($ct2)) {
  176.                 //
  177.                 if ($mc $this->goodsService->isBelongsToMcMc($goodsId$ct1$ct2)) {
  178.                     // 配下親カテゴリ/親カテゴリ
  179.                     // 本番環境: https://www.l-m.co.jp/item/11-8035/work/burtle.html
  180.                     // 検証環境: https://stg.l-m.co.jp/item/11-8035/work/burtle.html
  181.                     // 開発環境: https://eccube.l-m.local/item/11-8035/work/burtle.html
  182.                     $mcMcWebName $ct1;
  183.                     $mcWebName $ct2;
  184.                 } else if ($mc $this->goodsService->isBelongsToMcCt($goodsId$ct1$ct2)) {
  185.                     // 親カテゴリ/子カテゴリ
  186.                     // 本番環境: https://www.l-m.co.jp/item/27-00141NVP/polo/gekiyasu.html
  187.                     // 検証環境: https://stg.l-m.co.jp/item/27-00141NVP/polo/gekiyasu.html
  188.                     // 開発環境: https://eccube.l-m.local/item/27-00141NVP/polo/gekiyasu.html
  189.                     $mcWebName $ct1;
  190.                     $ctWebName $ct2;
  191.                 }
  192.             } else if (!empty($ct1)) {
  193.                 //
  194.                 if ($mc $this->goodsService->isBelongsToMc($goodsId$ct1)) {
  195.                     // 配下親カテゴリ
  196.                     // 本番環境: https://www.l-m.co.jp/item/11-8035/work.html
  197.                     // 検証環境: https://stg.l-m.co.jp/item/11-8035/work.html
  198.                     // 開発環境: https://eccube.l-m.local/item/11-8035/work.html
  199.                     // 親カテゴリ
  200.                     // 本番環境: https://www.l-m.co.jp/item/27-00141NVP/polo.html
  201.                     // 検証環境: https://stg.l-m.co.jp/item/27-00141NVP/polo.html
  202.                     // 開発環境: https://eccube.l-m.local/item/27-00141NVP/polo.html
  203.                     // 親カテゴリ(親カテのみ)
  204.                     // 本番環境: https://www.l-m.co.jp/item/27-00141NVP/election-item.html
  205.                     // 検証環境: https://stg.l-m.co.jp/item/27-00141NVP/election-item.html
  206.                     // 開発環境: https://eccube.l-m.local/item/27-00141NVP/election-item.html
  207.                     $mcWebName $ct1;
  208.                 }
  209.             }
  210.             //
  211.             if (empty($mcMcWebName) && empty($mcWebName) && empty($ctWebName)) {
  212.                 // 複製商品URLが不正
  213.                 throw new NotFoundHttpException();
  214.             }
  215.         }
  216.         //
  217.         $device strtolower($this->CommonService->GetDevice());
  218.         // 「非表示商品」※社内限定
  219.         $is_secret LmHelper::isSecret();
  220.         //
  221.         $masterCacheKey self::getMasterCacheKey($goodsId);
  222.         // 絞込み対応(SESSION内の検索条件をキャッシュIDのサフィックス生成要素に加える)
  223.         $suffix = (function($mcMcWebName$mcWebName$ctWebName) {
  224.             //
  225.             $_params compact('mcMcWebName''mcWebName''ctWebName');
  226.             //
  227.             return !empty($_params) ? hash('sha256'base64_encode(serialize($_params))) : '';
  228.         })($mcMcWebName$mcWebName$ctWebName);
  229.         //
  230.         $viewCacheKey "{$masterCacheKey}__{$device}_view__{$suffix}";
  231.         //
  232.         $masterCache $this->handleMasterCache($masterCacheKey$device, [
  233.             $viewCacheKey,
  234.         ]);
  235.         // 最近チェックした商品(cookie)
  236.         //$useCache = false;
  237.         $cookies=$this->RecentGoodsService->getRecentList($goodsId);
  238.         $recentviews = array();
  239.         if(!empty($cookies)){
  240.             $recentviews=$this->RecentGoodsService->LM_getRecentViews2($cookies);
  241.         }
  242.         //
  243.         return array_merge($this->getCacheByKey($viewCacheKey, function () use ($request$goods$is_secret$mc$mcMcWebName$mcWebName$ctWebName) {
  244.             //
  245.             return $this->_detail($request$goods$is_secret$mc$mcMcWebName$mcWebName$ctWebName);
  246.         }), [
  247.             'recentviews' => $recentviews,
  248.         ]);
  249.     }
  250.     /**
  251.      * @param Request $request
  252.      * @param GoodsWithRelated $goods 商品エンティティ
  253.      * @param bool $is_secret
  254.      * @param null|array $mc 親カテゴリ情報
  255.      * @param null|string $mcMcWebName 配下親カテゴリURL
  256.      * @param null|string $mcWebName 親カテゴリURL
  257.      * @param null|string $ctWebName 子カテゴリURL
  258.      * @return array
  259.      */
  260.     public function _detail(Request $requestGoods $goods$is_secret$mc null$mcMcWebName null$mcWebName null$ctWebName null)
  261.     {
  262.         //
  263.         $id $goods->getGoodsId();
  264.         //
  265.         $parameters array_merge($this->__detail($request$id$is_secret$mc$mcMcWebName$mcWebName$ctWebName), [
  266.             'goods' => $goods,
  267.             'goods_name_with_vending_status' => $goods->getVendingStatusLabel()->isShowLabel() ? "[{$goods->getVendingStatusLabel()->getLabel()}]{$goods->getGoodsName()}$goods->getGoodsName(),
  268.             'back_to_top_link' => $goods->getGoodsName() . str_replace("品番"""$goods->getGoodsMainKataban()),
  269.         ]);
  270.         //
  271.         return $parameters;
  272.     }
  273.     /**
  274.      * @param Request $request
  275.      * @param int $id 商品ID
  276.      * @param bool $is_secret シークレットプレビュー
  277.      * @param null|array $mc 親カテゴリ情報
  278.      * @param null|string $mcMcWebName 配下親カテゴリURL
  279.      * @param null|string $mcWebName 親カテゴリURL
  280.      * @param null|string $ctWebName 子カテゴリURL
  281.      * @return array
  282.      */
  283.     public function __detail(Request $request$id$is_secret$mc null$mcMcWebName null$mcWebName null$ctWebName null)
  284.     {
  285.         // バリデーション
  286.         if (($data $this->goodsService->getGoodsById($id)) === false) {
  287.             // 商品が見つからない
  288.             throw new NotFoundHttpException();
  289.         }
  290.         $Product $this->productRepository->find($id);
  291.         $productConverter = new ProductConverter();
  292.         //
  293. //        if ($data['goods_set_purchase_flg'] == 1) {
  294. //            var_dump(compact('color', 'size', 'stock'));
  295. //            exit;
  296. //        }
  297.         // 色情報
  298.         $color $this->goodsService->getGoodsColorSelectSql($id);
  299.         // サイズ情報
  300.         $size $this->goodsService->getGoodsSizeListById($id);
  301.         // 商品予約情報
  302.         $isYoyakuAvailable $this->goodsService->getGoodsReservation($id);
  303.         // 商品即日情報
  304.         $sokujitsu $this->goodsService->getGoodsSameDayShipping($id,1);
  305.         //即日バナー表示チェック
  306.         $sokujitsu = !empty($sokujitsu) ? $sokujitsu : [];
  307.         $sokujitsu['type'] = 0;
  308.         $shiiresaki $productConverter->getShiiresakiById($data['goods_shiiresaki']);
  309.         $result $this->goodsService->getGoodsSameDayShipping($id);
  310.         if ($result) {
  311.             $sokujitsu['type'] = json_encode($result);
  312.             //即日の発注締め時刻
  313.             if ($sokujitsu['type'] == 1) {
  314.                 $imgPath "/images/itempage/chokusou/";
  315.                 $imgPath2 "/images/itempage/chokusou/";
  316.                 $sokujitsu['timeLimit'] = substr($shiiresaki['shiiresaki_shimekiri_time'], strpos($shiiresaki['shiiresaki_shimekiri_time'], ' ') + 12);
  317.                 $sokujitsu['img1'] = $imgPath "banner{$data['goods_shiiresaki']}_s.webp";
  318.                 $sokujitsu['img2'] = $imgPath "banner{$data['goods_shiiresaki']}_sc.webp";
  319.                 $sokujitsu['img3'] = $imgPath2 "banner{$data['goods_shiiresaki']}.webp";
  320.             } elseif ($sokujitsu['type'] == 2) {
  321.                 $imgPath "/images/itempage/sokujitsu/";
  322.                 $sokujitsu['timeLimit'] = "16";
  323.                 $sokujitsu['img1'] = $imgPath "sokujitsu-mini-itempage.webp";
  324.                 $sokujitsu['img2'] = $imgPath "sokujitsu-mini-itempage.webp";
  325.                 $sokujitsu['img3'] = $imgPath "sokujitsu-itempage.webp";
  326.             }
  327.         }
  328.         $newTagList $this->dynamicConverter->getListByGoodsId(1$id);
  329.         // TODO: 新商品説明に入力があるか判定
  330.         $useNewItemDescription false;
  331.         $rs $this->dynamicConverter->getGoodsKatabanSelect($id);
  332.         $kataban '';
  333.         if (isset($rs)) {
  334.             $tmpRow 0;
  335.             foreach ($rs as $row) {
  336.                 $tmpRow++;
  337.                 if ($tmpRow 1) {
  338.                     $kataban .= ",";
  339.                 } else {
  340.                     $kataban .= "品番";
  341.                 }
  342.                     $kataban .= $row['gp_kataban'];
  343.             }
  344.         }
  345.         // TODO: hinbanStr 品番取得
  346.         $hinbanStr '';
  347.         $hinbanArr explode(','str_replace("品番"""$kataban));
  348.         foreach ($hinbanArr as $idx => $hinban) {
  349.             if ($val mb_strstr($hinban'-'false)) {
  350.                 $hinbanStr .= str_replace('-'''$val);
  351.             } else {
  352.                 $hinbanStr .= $hinban;
  353.             }
  354.             if ($idx != count($hinbanArr) - 1$hinbanStr .= ',';
  355.         }
  356.         // 新商品説明
  357.         $newDescriptionColors null;
  358.         if(
  359.             (!is_null($data['goods_new_description']) && $data['goods_new_description'] !== '') ||
  360.             (!is_null($data['goods_new_material']) && $data['goods_new_material'] !== '') ||
  361.             (!is_null($data['goods_new_spec']) && $data['goods_new_spec'] !== '') ||
  362.             (!is_null($data['goods_new_annotation']) && $data['goods_new_annotation'] !== '') ||
  363.             (!is_null($data['goods_new_name']) && $data['goods_new_name'] !== '') ||
  364.             (!is_null($data['goods_new_maker']) && $data['goods_new_maker'] !== '')
  365.         ){
  366.             $useNewItemDescription true;
  367.             $rs $this->dynamicConverter->getGoodsColorSelect($id);
  368.             if (isset($rs)) {
  369.                 $color_array = array();
  370.                 foreach ($rs as $row) {
  371.                     $color_array[] = $row['color_name'];
  372.                 }
  373.                 $newDescriptionColors implode('、'$color_array);
  374.             }
  375.         }
  376.         // TODO: 関連商品一覧
  377.         //$displayRelative = "";
  378.         //お客様の声
  379.         list($messages$messagesTotal) = $this->MessageService->getCustomerMessagesAndCount($id1);
  380.         $messages $this->MessageService->formatCustomerMessages($messages);
  381.         // TODO: 下部ボタン
  382.         $ct $_GET['ct'] ?? '';
  383.         $mc $_GET['mc'] ?? '';
  384.         $get_parameter $this->createGetParamater($_GET);
  385.         // 大フッター(商品)
  386.         $largeFooterList $this->dynamicConverter->getLargeFooterListByGoodsId(1$id);
  387.         // TODO: フッターリンク(カテゴリ)
  388.         $canonicalPankuzuMainCategory = [];
  389.         // TODO: フッタ2
  390.         $pagebottomCache null;
  391.         // TODO: 上部差込み
  392.         $SET_GOODS_DETAIL_TOP_SASHIKOMI_COUNT 31;
  393.         $ItemSashikomiImageModel = [
  394.             'TYPE_BASE_01' => 'base_01',
  395.             'WEARING_IMAGE_MAX_COUNT' => 4,
  396.             'TYPE_HANGER_ILLUST' => 'hanger_illust',
  397.             'TYPE_FABRIC' => 'fabric',
  398.             'TYPE_UPPER' => 'upper',
  399.             'TYPE_MID_SOLE' => 'mid_sole',
  400.             'TYPE_OUT_SOLE' => 'out_sole',
  401.             'TYPE_DETAIL_FRONT_BACK' => 'detail_front_back',
  402.             'TYPE_DETAIL_COLUMN' => 'detail_column',
  403.             'TYPE_MODEL_MENS' => 'model_mens',
  404.             'TYPE_MODEL_LADIES' => 'model_ladies',
  405.             'TYPE_BASE_03' => 'base_03',
  406.             'TYPE_COLOR_VARIATION' => 'color_variation',
  407.             'TYPE_COLORUP' => 'colorup',
  408.             'TYPE_SIZE_SILHOUETTE' => 'size_silhouette',
  409.             'TYPE_POCKET_SIZE_AREA' => 'pocket_size_area',
  410.             'TYPE_PRINT_AREA' => 'print_area'
  411.         ];
  412.         //$CFIMG_DOMAIN = "img0.land-mark.biz";
  413.         //$CFIMG_URL = "https://{$CFIMG_DOMAIN}/ut_img/";
  414.         $show_sashikomi_target_gender_src 'public_images/categorypage/banner/work/work-ss-hayawari-itempage-1col.jpg';
  415.         $show_sashikomi_target_gender_alt '';
  416.         // 性別表記の差し込み画像
  417.         $target_gender_image = array(
  418.             "",
  419.             "itempage/805px/caution/mens-item.jpg",
  420.             "itempage/805px/caution/ladies-item.jpg",
  421.             "itempage/805px/caution/unisex-item.jpg",
  422.             "itempage/805px/caution/kids-item.jpg",
  423.         );
  424.         $target_gender_image_alt = array(
  425.             "",
  426.             "この商品は男性用です",
  427.             "この商品は女性用です",
  428.             "この商品は男女兼用です",
  429.             "この商品は子ども用です",
  430.         );
  431.         if (isset($data['goods_target_gender'])) {
  432.             $target_gender_id $data['goods_target_gender'] ?: 0;
  433.             $show_sashikomi_target_gender_src $target_gender_image[$target_gender_id];
  434.             $show_sashikomi_target_gender_alt $target_gender_image_alt[$target_gender_id];
  435.         }
  436.         $goodsSeriesList $this->dynamicConverter->getGoodsSeriesListByGoodsId($id);
  437.         $sashikomi_image_info_map $this->dynamicConverter->getSashikomiImageInfoMap($id);
  438.         //TODO: プリント
  439.         $breadCrumbCategoryName2 $data['goods_breadcrumb_category_name2'];
  440.         //サイズ表
  441.         list($SizeList,$SizePosition) = $this->dynamicConverter->LM_displaySizeMatrix_cross2($id);
  442.         $goods_name_with_vending_status '';
  443.         $mainImage $this->dynamicConverter->getGoodsImage($id,$data['goods_name']);
  444.         list($mainUrl,$mainUrlSum,$comment) = $mainImage;
  445.         $thumbCount 0;
  446.         $is_preview_mode false;
  447.         $displayTeika $this->dynamicConverter->LM_displayteika_new($id);
  448.         $displayPrice $this->dynamicConverter->LM_displayPriceList3($id); // 販売価格
  449.         $displayPrice2 "";
  450.         if (isset($displayPrice['mi']) and isset($displayPrice['ma']) and $displayPrice['mi'] != $displayPrice['ma']) {
  451.             $displayPrice2 number_format($displayPrice['mi']) . '円~' number_format($displayPrice['ma']).'円(税込)';
  452.         }
  453.         $isShowLeftmenu true;
  454.         //$mainUrlSum = "";
  455.         define("_VIEW_ITEM_DETAIL_FLAG_" $data['goods_id'], "on");
  456.         $lm_displayHosokuSetsumei2 $this->LM_displayHosokuSetsumei2($data);
  457.         $REQUEST_URI '';
  458.         $displayShoppingCart "";
  459.         $DISPLAY_LINES 6;
  460.         $partialCounter "";
  461.         $partialCounter mb_convert_kana($partialCounter'A');
  462.         $isDisplaySetCoo true;
  463. /*
  464.         $goodsSetCooList = [
  465.             [
  466.                 'data' => $data,
  467.                 'displayTeika' => $displayTeika,
  468.                 'displayPrice' => $displayPrice,
  469.                 'displayPrice2' => $displayPrice2,
  470.                 'mainUrl' => $mainUrl,
  471.                 'mainUrlSum' => $mainUrlSum,
  472.                 'comment' => $comment,
  473.                 'useCache' => $useCache,
  474.                 'is_preview_mode' => $is_preview_mode,
  475.                 'isShowLeftmenu' => $isShowLeftmenu,
  476.                 'is_secret' => $is_secret,
  477.                 'displayOther' => $displayOther,
  478.                 'thumbCount' => $thumbCount,
  479.                 'displayShoppingCart' => $displayShoppingCart,
  480.                 'DISPLAY_LINES' => $DISPLAY_LINES,
  481.                 'breadCrumb' => $breadCrumb,
  482.             ]
  483.         ];
  484. */
  485.         // SPページ Commonデータ取得
  486.         $custom_menu $this->dynamicConverter->getMenuGroup($this->eccubeConfig['EditSpMenu']['MENU_NAME_COMMON'], $this->eccubeConfig['EditSpMenu']['BOOL_TRUE']);
  487.         $custom_frequently_searched_word $this->dynamicConverter->getSearchWordGroup($this->eccubeConfig['EditSpMenu']['MENU_NAME_COMMON'], $this->eccubeConfig['EditSpMenu']['BOOL_TRUE']);
  488.         // コーディネート
  489.         $coItemList = [];
  490.         $tempRow $this->dynamicConverter->getSearchCoordinate($id);
  491.         if (isset($tempRow) && sizeof($tempRow) > 0) {
  492.             $goods_design_coo $tempRow[0]['goods_design_coo'];
  493.             $coItemList $this->dynamicConverter->getCoosData($goods_design_coo);
  494.             $coItemList = empty($coItemList) ? [] : $coItemList;
  495.         }
  496.         // ⑳【LM】売れ筋商品一覧(SP)
  497.         $mcName $request->get('mcName');
  498.         $ctName $request->get('ctName');
  499.         $mcId $request->get('mcId');
  500.         $ctId $request->get('ctId');
  501.         $isOnlyMain false;
  502.         if (isset($mcName) && $mcName != '') {
  503.             $categoryParam = array(
  504.                 'mc' => $mcName,
  505.                 'ct' => $ctName,
  506.             );
  507.         } else {
  508.             if (!empty($breadCrumb[1])) {
  509.                 $matches = array();
  510.                 if (preg_match('/^(?:https?:\/\/)?(?:www\.)?(?:l-m\.co\.jp)?(?:\/)?([^\/]+)(?:\/)?([^\/]+)?/'$breadCrumb[1]['href'], $matches)) {
  511.                     $categoryParam = array();
  512.                     if (!empty($matches[1])) {
  513.                         $categoryParam['mc'] = $matches[1];
  514.                     }
  515.                     if (!empty($matches[2])) {
  516.                         $categoryParam['ct'] = $matches[2];
  517.                     } else{
  518.                         $categoryParam['ct'] = 'allitem';
  519.                     }
  520.                 }
  521.             } else if (!empty($mct)) {
  522.                 $categoryParam = array(
  523.                     'mc' => $mct,
  524.                     'ct' => 'allitem',
  525.                 );
  526.             }
  527.         }
  528.         $breadCrumb $this->dynamicConverter->getBreadCrumbsByGoodsId($id);
  529.         $popularData "";
  530.         $category_data = [];
  531.         if (!empty($categoryParam)) {
  532.             $tempRow $this->dynamicConverter->getMainCategoryNameSelect($categoryParam['mc']);
  533.             if (isset($tempRow)) {
  534.                 $mcId $tempRow[0]['main_category_id'];
  535.                 $mcName $categoryParam['mc'];
  536.                 $isOnlyMain = (int)$tempRow[0]['category_group_only_main'] === 1;
  537.                 if ($categoryParam['ct'] == "allitem") {
  538.                     $ctId "allitem";
  539.                     $ctName "allitem";
  540.                 } elseif (isset($categoryParam['ct']) and $categoryParam['ct'] != "") {
  541.                     $tempRow $this->dynamicConverter->getSubCategoryNameSelect($mcId$categoryParam['ct']);
  542.                     if (isset($tempRow)) {
  543.                         $ctId $tempRow[0]['category_id'];
  544.                         $ctName $categoryParam['ct'];
  545.                     }
  546.                 }
  547.             }
  548.             $popularData $this->dynamicConverter->getPopularityItemLIstByMainCategoryId2($mcId$is_secretself::SP_RECOMMEND_ITEM_LIST_COUNT 1);
  549.             foreach( $popularData as $idx => $item_data){
  550.                 if((string)$item_data['goods_id'] === (string)$id){
  551.                     unset($popularData[$idx]);
  552.                     break;
  553.                 }
  554.             }
  555.             $popularData array_slice($popularData0self::SP_RECOMMEND_ITEM_LIST_COUNT);
  556.             if ($categoryParam['ct'] == 'allitem' && $categoryParam['mc'] != '') {
  557.                 $tempRow $this->dynamicConverter->getSearchAllCategory($categoryParam['mc']);
  558.                 if (isset($tempRow) && sizeof($tempRow) > 0) {
  559.                     $category_data $tempRow[0];
  560.                 }
  561.             } else if ($categoryParam['ct'] != '' && $categoryParam['mc'] != '') {
  562.                 $tempRow $this->dynamicConverter->getSearchGoodsImage($categoryParam['mc'], $categoryParam['ct']);
  563.                 if (isset($tempRow) && sizeof($tempRow) > 0) {
  564.                     $category_data $tempRow[0];
  565.                 }
  566.             } else if ($categoryParam['mc'] != '') {
  567.                 $tempRow $this->dynamicConverter->getSearchCategory($categoryParam['mc']);
  568.                 if (isset($tempRow) && sizeof($tempRow) > 0) {
  569.                     $category_data $tempRow[0];
  570.                 }
  571.             } else {
  572.                 $category_data $data;
  573.             }
  574.         } else {
  575.             $popularData $this->recommendationService->getRecommendationList($breadCrumb[0]['label'], self::SP_RECOMMEND_ITEM_LIST_COUNT);
  576.         }
  577.         // 当商品の掲載カテゴリ//////////////////////////////////////////////////////////////////
  578.         $displayCategory '';
  579.         // 商品カテゴリの判定
  580.         if (!empty($mcId)) {
  581.             $mct $this->dynamicConverter->getMainCategoryWebnameByMcId($mcId);
  582.         } else {
  583.             // 800-172「当商品の掲載カテゴリ」と「パンくず(※canonicalのURLの場合は一番掲載の多い親カテゴリを表示する)」の処理
  584.             $mct $this->dynamicConverter->detectMainCategory($id);
  585.         }
  586.         $additionalList $this->dynamicConverter->getMainCategorySqlFromGoodsId2($id);
  587.         $is_except_supersale true;
  588.         if (!$this->mobileDetector->isMobile()
  589.             && empty($additionalList)
  590.             && ($mct == 'work' || $mct == 'jimufuku' || $mct == 'medical-hakui')
  591.         ) {
  592.             $displayCategory $this->dynamicConverter->LM_displayCategory($id$is_except_supersale);
  593.             $DISPLAY_LINES 6;
  594.         } else {
  595.             $displayCategory $this->dynamicConverter->LM_displayCategory4($id$mct$additionalList$is_except_supersale);
  596.             $DISPLAY_LINES 99;
  597.         }
  598.         $canonicalPankuzuMainCategory $displayCategory['canonicalPankuzuMainCategory'];
  599.         $displayCategory $displayCategory['viewStr'];
  600.         //パンくず//////////////////////////////////////////////////////////////////////////////
  601.         // 2023.07.28 取得した変数が利用されていないため、処理を全てコメントアウトする
  602.         /*
  603.         if (!empty($mcId)) {
  604.             $result = $this->dynamicConverter->getCategoryData($mcId,$ctId);
  605.             $urlCategory = array_shift($result);
  606.         }
  607.         // パンくずセット
  608.         // TODO: 相関エンティティに移植
  609.         $snipetCategory = $canonicalPankuzuMainCategory[0]['main_name'];
  610.         */
  611.         //パンくずEND//////////////////////////////////////////////////////////////////////////////
  612.         // TODO: ⑪【LM】在庫一覧(SP)
  613.         $reviewTotal 10;
  614.         $average 4.5;
  615.         $teika $this->dynamicConverter->LM_displayteika_new($idtrue);
  616. /*
  617.         //SP商品詳細色
  618.         $colors = [
  619.             [
  620.                 'gcl_id' => 97964,
  621.                 'color_name' => "カラー1",
  622.                 'color_rgb' => "#ffcc88",
  623.                 'color_num' => 1
  624.             ],
  625.             [
  626.                 'gcl_id' => 97965,
  627.                 'color_name' => "カラー2",
  628.                 'color_rgb' => "#ffcc88",
  629.                 'color_num' => 2
  630.             ],
  631.             [
  632.                 'gcl_id' => 97966,
  633.                 'color_name' => "カラー3",
  634.                 'color_rgb' => "#ffcc88",
  635.                 'color_num' => 3
  636.             ],
  637.             [
  638.                 'gcl_id' => 97967,
  639.                 'color_name' => "カラー4",
  640.                 'color_rgb' => "#ffcc88",
  641.                 'color_num' => 4
  642.             ],
  643.             [
  644.                 'gcl_id' => 97968,
  645.                 'color_name' => "カラー5",
  646.                 'color_rgb' => "#ffcc88",
  647.                 'color_num' => 5
  648.             ],
  649.             [
  650.                 'gcl_id' => 98125,
  651.                 'color_name' => "カラー6",
  652.                 'color_rgb' => "#ffcc88",
  653.                 'color_num' => 6
  654.             ],
  655.         ];*/
  656.         //TODO: カート情報
  657.         $goods_color_size_stock_list $this->dynamicConverter->getStockList($id);
  658.         $stockNyukayoteiList = [];
  659.         if (!empty($goods_color_size_stock_list)) {
  660.             foreach ($goods_color_size_stock_list as $goods_color_size_stock) {
  661.                 // 在庫確認
  662.                 $gcl_id $goods_color_size_stock['gcl_id'];
  663.                 $gp_id $goods_color_size_stock['gp_id'];
  664.                 $chokusouFlg "";
  665.                 $chokusouFlg $this->dynamicConverter->LM_chokusouCheck($id$gcl_id$gp_id);
  666.                 $stock_row $goods_color_size_stock;
  667.                 $stock 0;
  668.                 if (!is_numeric($stock_row['stock'])) {
  669.                     $stock $stock_row['stock'];
  670.                 } else {
  671.                     $stock $stock_row['stock']+intval($stock_row['jan_stock3'])+intval($stock_row['jan_stock4'])+intval($stock_row['jan_stock5'])+intval($stock_row['jan_stock6'])+intval($stock_row['jan_stock7'])+intval($stock_row['jan_stock8'])+intval($stock_row['jan_stock9']);
  672.                     if(intval($stock_row['jan_stock3'])>and $stock_row['jan_stock3_nyuka_date']==""){
  673.                         $stock .= " (即日発送 ".intval($stock_row['jan_stock3']).")";
  674.                     }elseif(intval($stock_row['jan_stock3'])>and $stock_row['jan_stock3_nyuka_date']!=""){
  675.                         $stock .= '<div class="nyuka-yotei" style="font-size:12px;">入荷予定日<br />' date("n月j日"strtotime($stock_row['jan_stock3_nyuka_date']." +1 day")) . '</div>';
  676.                         $stockNyukayoteiList[$stock_row['jan_color']][$stock_row['jan_price']] = date("n月j日"strtotime($stock_row['jan_stock3_nyuka_date']." +1 day"));
  677.                     }elseif($chokusouFlg==1){
  678.                         $stock .= " (即日発送 ".intval($stock).")";
  679.                     }
  680.                 }
  681.                 $stockList[$gcl_id][$gp_id] = $stock;
  682.                 if ($stock_row['keppin']) {
  683.                     $stockKeppinList[$gcl_id][$gp_id] = true;
  684.                 } else {
  685.                     $stockKeppinList[$gcl_id][$gp_id] = false;
  686.                 }
  687.             }
  688.         }
  689.         $stockList = !empty($stockList) ? $stockList : [];
  690.         $stockKeppinList = !empty($stockKeppinList) ? $stockKeppinList : [];
  691.         $holidayRecord $this->dynamicConverter->getIsHoliday();
  692.         $nowtime time();
  693.         // 営業時間
  694.         $businessHourFromTime strtotimedate('Y-m-d '.$this->lmHelper->getConfig('BUSINESS_HOUR_FROM_TIME'), $nowtime) );
  695.         $businessHourToTime strtotimedate('Y-m-d '.$this->lmHelper->getConfig('BUSINESS_HOUR_TO_TIME'), $nowtime) );
  696.         if( count($holidayRecord) > ) {
  697.             $isOutOfService true;
  698.         }
  699.         else if( $nowtime $businessHourFromTime || $nowtime $businessHourToTime ){
  700.             $isOutOfService true;
  701.         }
  702.         else{
  703.             $isOutOfService false;
  704.         }
  705.         $goods_set_purchase_list $this->dynamicConverter->getGoodsSetPurchaseList($id);
  706.         $canonicalHinban $data['goods_canonical_hinban'];
  707.         $item_id = !empty($canonicalHinban) ? $canonicalHinban $data['goods_id'];
  708.         $rs $this->dynamicConverter->getJanShireColorData($id);
  709.         $color_number_map = [];
  710.         if (isset($rs)) {
  711.             foreach($rs as $row){
  712.                 $color_number_map$row['jan_color'] ] = is_null($row['jan_shiire_color']) ? '' $row['jan_shiire_color'];
  713.             }
  714.         }
  715.         $goods_set_map $this->dynamicConverter->convertGoodsSetPurchaseListToMap($goods_set_purchase_list);
  716.         //
  717.         $item = new Item($id);
  718.         // お客様からの口コミレビュー ///////////////////////////////////////////////////////////////
  719.         $allReviews $this->ReviewService->GetReview($id$reviewCountnull);
  720.         $reviewAdd = array('average'=>0,'star'=>0,'count'=>0,'hasMoreReview'=>0);
  721.         if(!empty($allReviews)){
  722.             $cr_points array_map(function ($v) {
  723.                 return $v["cr_points"];
  724.             }, $allReviews);
  725.             $reviewAdd['count'] = $reviewCount;
  726.             $reviewAdd['hasMoreReview'] = $this->lmHelper->getConfig('ITEM_PAGE_REVIEW_LIMIT');
  727.             $argarray_sum($cr_points) / count($cr_points);
  728.             $reviewAdd['average'] = (floor($arg 10)) / 10;
  729.             $reviewAdd['star'] = ((int)($arg 2) / 2) * 10;
  730.         }
  731.         $review array_slice($allReviews0$this->lmHelper->getConfig('ITEM_PAGE_REVIEW_LIMIT'));
  732.         // お客様からの口コミレビューEND/////////////////////////////////////////////////////////////
  733.         $this->dataLayer['gdn']['items'][] = $this->CommonService->get_google_retargeting_item($id);
  734.         $this->dataLayer['ydn']['yahoo_retargeting_items'][] = $this->CommonService->get_yahoo_retargeting_item($id);
  735.         $this->dataLayer['criteo']['item'] = $id;
  736.         $imgrow="";
  737.         $isMobile $this->mobileDetector->isMobile();
  738.         if (!$isMobile) {
  739.             if (!empty($data['goods_bottom_sashikomi'])) {
  740.                 $data['goods_bottom_sashikomi'] = str_replace('/805px/work/itempage-work-hot-inner.jpg"''/805px/work/itempage-work-hot-inner.jpg" width="805px" height="150px"'$data['goods_bottom_sashikomi']);
  741.             }
  742.         }
  743.         $koeCategory = array(
  744.             => "Tシャツ",
  745.             => "アロハシャツ",
  746.             => "エステユニフォーム",
  747.             => "エプロン",
  748.             => "キャップ",
  749.             => "キャップ/ハット",
  750.             => "コックコート",
  751.             => "シャツ",
  752.             => "ジャンパー",
  753.             10 => "ジャージ",
  754.             11 => "スウェット",
  755.             12 => "スカート",
  756.             13 => "スクラブ",
  757.             14 => "チュニック",
  758.             15 => "ツナギ服",
  759.             16 => "トレーナー",
  760.             17 => "ネクタイ",
  761.             18 => "ハッピ",
  762.             19 => "バッグ",
  763.             20 => "バンダナ",
  764.             21 => "パンツ",
  765.             22 => "パーカー",
  766.             23 => "ベスト",
  767.             24 => "ポロシャツ",
  768.             25 => "ワンピース",
  769.             26 => "作業服",
  770.             27 => "医療",
  771.             29 => "安全靴",
  772.             30 => "白衣",
  773.             31 => "防寒服"
  774.         );
  775.         $koeCategoryName $canonicalPankuzuMainCategory[0]["main_name"] ?? null;
  776.         $koeCategoryId =array_search($koeCategoryName$koeCategory);
  777.         return [
  778.             'data' => $data,
  779.             'newTagList' => $newTagList,
  780.             'useNewItemDescription' => $useNewItemDescription,
  781.             'hinbanStr' => $hinbanStr,
  782.             'newDescriptionColors' => $newDescriptionColors,
  783.             //'displayRelative' => $displayRelative,
  784.             'displayCategory' => $displayCategory,
  785.             //'useCache' => $useCache,
  786.             //'recentviewsSwitch' => $recentviewsSwitch,
  787.             'ct' => $ct,
  788.             'mc' => $mc,
  789.             'get_parameter' => $get_parameter,
  790.             'is_secret' => $is_secret,
  791.             'largeFooterLis' => $largeFooterList,
  792.             'canonicalPankuzuMainCategory' => $canonicalPankuzuMainCategory,
  793.             'pagebottomCache' => $pagebottomCache,
  794.             'SET_GOODS_DETAIL_TOP_SASHIKOMI_COUNT' => $SET_GOODS_DETAIL_TOP_SASHIKOMI_COUNT,
  795.             'ItemSashikomiImageModel' => $ItemSashikomiImageModel,
  796.             'sashikomi_image_info_map' => $sashikomi_image_info_map,
  797.             //'CFIMG_URL' => $CFIMG_URL,
  798.             //'directFlg' => $directFlg,
  799.             //'CFIMG_DOMAIN' => $CFIMG_DOMAIN,
  800.             //'chokusouOrderDeadline' => $chokusouOrderDeadline,
  801.             'show_sashikomi_target_gender_alt' => $show_sashikomi_target_gender_alt,
  802.             'show_sashikomi_target_gender_src' => $show_sashikomi_target_gender_src,
  803.             'goodsSeriesList' => $goodsSeriesList,
  804.             'kiji_thickness_list'=> $this->lmHelper->getConfig('KIJI_THICKNESS_LIST'),
  805.             'kiji_hardness_list' => $this->lmHelper->getConfig('KIJI_HARDNESS_LIST'),
  806.             'kiji_stretch_list' => $this->lmHelper->getConfig('KIJI_STRETCH_LIST'),
  807.             'breadCrumbCategoryName2' => $breadCrumbCategoryName2,
  808.             'SizeList' => $SizeList,
  809.             'SizePosition' => $SizePosition,
  810.             'breadCrumb' => $breadCrumb,
  811.             'BreadCrumbs' => $breadCrumb,
  812.             'messages' => $messages,
  813.             'messagesTotal' => $messagesTotal,
  814.             'goods_name_with_vending_status' => $goods_name_with_vending_status,
  815.             'mainUrl' => $mainUrl,
  816.             'comment' => $comment,
  817.             'thumbCount' => $thumbCount,
  818.             'is_preview_mode' => $is_preview_mode,
  819.             'displayTeika' => $displayTeika,
  820.             'displayPrice' => $displayPrice,
  821.             'displayPrice2' => $displayPrice2,
  822.             'isShowLeftmenu' => $isShowLeftmenu,
  823.             'displayTogether' => $this->ReviewService->LM_displayTogetherBuyDetail_new3($id),
  824.             //'LOGIN' => $LOGIN,
  825.             //'displayZaiko' => $displayZaiko,
  826.             //'sendDate' => $sendDate,
  827.             //'displayOther' => $displayOther,
  828.             'mainUrlSum' => $mainUrlSum,
  829.             'lm_displayHosokuSetsumei2' => $lm_displayHosokuSetsumei2,
  830.             'REQUEST_URI' => $REQUEST_URI,
  831.             'displayShoppingCart' => $displayShoppingCart,
  832.             'DISPLAY_LINES' => $DISPLAY_LINES,
  833.             'partialCounter' => $partialCounter,
  834.             'isDisplaySetCoo' => $isDisplaySetCoo,
  835.             //'goodsSetCooList' => $goodsSetCooList,
  836.             'custom_menu' => $custom_menu,
  837.             'custom_frequently_searched_word' => $custom_frequently_searched_word,
  838.             'review' => $review,
  839.             'reviewAdd'=>$reviewAdd,
  840.             'coItemList' => $coItemList,
  841.             'popularData' => $popularData,
  842.             'category_data' => $category_data,
  843.             'mcId' => $mcId,
  844.             'mcName' => $mcName,
  845.             'ctId' => $ctId,
  846.             'ctName' => $ctName,
  847.             'imgrow' => $imgrow,
  848.             'reviewTotal' => $reviewTotal,
  849.             'average' => $average,
  850.             'teika' => $teika,
  851.             //'sizeData' => $sizeData,
  852.             //'sizeNameList' => $sizeNameList,
  853.             //'sizeData2' => $sizeData2,
  854.             //'sizecomments' => $sizecomments,
  855.             'isOutOfService' => $isOutOfService,
  856.             'stockList' => $stockList,
  857.             'stockKeppinList' => $stockKeppinList,
  858.             'goods_set_purchase_list' => $goods_set_purchase_list,
  859.             'item' => $item,
  860.             'item_id' => $item_id,
  861.             'stockNyukayoteiList' => $stockNyukayoteiList,
  862.             'color_number_map' => $color_number_map,
  863.             'goods_set_map' => $goods_set_map,
  864.             'sokujitsu' => $sokujitsu,
  865.             //'Category1' => $category1,
  866.             //'Category1_price' => $category1_price,
  867.             //'Category2' => $category2,
  868.             //'ProductClass' => $productClasses,
  869.             'Product' => $Product,
  870.             'size' => $size,
  871.             'color' => $color,
  872.             'MetaTags' => ['item'=>$data], #2022/08/08 kawai
  873.             'dataLayer' => $this->dataLayer,
  874.             'isYoyakuAvailable' => $isYoyakuAvailable,
  875.             'isMobile' => $isMobile,
  876.             'koeCategoryName' => $koeCategoryName,
  877.             'koeCategoryId' => $koeCategoryId,
  878.         ];
  879.     }
  880.     /**
  881.      * @param Request $request
  882.      * #Route("/item/friend", name="item/friend", methods={"GET"})
  883.      * @Template("Item/friend.twig")
  884.      */
  885.     public function friend(Request $request)
  886.     {
  887.         //
  888.         if (!($goodsId $request->get('id'))) {
  889.             throw new NotFoundHttpException();
  890.         }
  891.         //
  892.         $sql = new SqlService();
  893.         $data $sql->Table('goods_table')
  894.             ->Set('goods_id'$goodsId)
  895.             ->Find();
  896.         //
  897.         return [
  898.             'data' => $data,
  899.         ];
  900.     }
  901.     /**
  902.      * @param Request $request
  903.      * @return mixed
  904.      * @Route("/item/searchlist", name="item_searchlist", methods={"GET", "POST"})
  905.      * @Template("Item/searchlist.twig")
  906.      */
  907.     public function searchlist(Request $requestSearchItemService $searchItemService)
  908.     {
  909.         //
  910.         $isMobile $this->mobileDetector->isMobile();
  911.         $searchtext $request->get('searchtext');
  912.         $orderType $request->get('orderType');
  913.         $page $request->get('page'1);
  914.         $itemsPerPage $request->get('items-per-page'$isMobile self:: SP_ITEMS_PER_PAGE self::ITEMS_PER_PAGE);
  915.         $maxPagingLinks $request->get('max-paging-links'$isMobile self:: SP_MAX_PAGING_LINKS self::MAX_PAGING_LINKS);
  916.         $params $request->query->all();
  917.         //
  918.         $BreadCrumbs = [
  919.             [
  920.                 'label' => "「{$searchtext}」の検索結果一覧",
  921.             ],
  922.         ];
  923.         //
  924.         $resultList $searchItemService->searchItemList($searchtext$itemsPerPage$itemsPerPage * ($page 1), $resultCount$orderType);
  925.         $pager LmHelper::paging($page$resultCount$itemsPerPage$maxPagingLinks$params);
  926.         //
  927.         if (($resultCount === 1) && ($item $resultList[0])) {
  928.             //
  929.             return $this->redirectToRoute('item/detail', ['id' => $item['goods_canonical_hinban'] ?? $item['goods_id'] ]);
  930.         } else {
  931.             //
  932.             $this->dataLayer['gdn']['items'] = array_map(function ($id) {
  933.                 return $this->CommonService->get_google_retargeting_item($id);
  934.             }, array_column(array_slice($resultList03), 'goods_id'));
  935.             $this->dataLayer['ydn']['yahoo_retargeting_items'] = array_map(function ($id) {
  936.                 return $this->CommonService->get_yahoo_retargeting_item($id);
  937.             }, array_column(array_slice($resultList03), 'goods_id'));
  938.             $this->dataLayer['criteo']['item'] = array_column(array_slice($resultList03), 'goods_id');
  939.             //
  940.             return [
  941.                 'BreadCrumbs' => $BreadCrumbs,
  942.                 'searchtext' => $searchtext,
  943.                 'resultCount' => $resultCount,
  944.                 'resultList' => $resultList,
  945.                 'pager' => $pager,
  946.                 'isMobile' => $isMobile,
  947.                 'dataLayer' => $this->dataLayer,
  948.             ];
  949.         }
  950.     }
  951.     /**
  952.      * @param Request $request
  953.      * #Route("/item/suggest", name="item_suggest", methods={"GET"})
  954.      * @Template("Item/suggest.twig")
  955.      */
  956.     public function suggest(Request $request)
  957.     {
  958.         //
  959.         // パラメータの解析
  960.         $searchtext $request->get('searchtext');
  961.         $display_max $request->get('display_max'0);
  962.         //
  963.         $keywords str_replace(' '' '$searchtext);
  964.         $keywords preg_split('/[ ]+/'$keywords);
  965.         // キーワードサジェスト
  966.         $keywords = (array)$searchtext;
  967. //
  968. //        // カテゴリサジェスト
  969. //        $categories = $obj->searchCategory($keywords, $display_max, 0, 'normal');
  970. //
  971. //        // ブランドサジェスト
  972. //        $brands = $obj->searchCategory($keywords, $display_max, 0, 'brand');
  973. //
  974. //        // 説明サジェスト
  975. //        $descriptions = $obj->searchCategory($keywords, $display_max, 0, 'description');
  976. //
  977. //        // view用に変換
  978. //        $this->view->searchtext = $searchtext;
  979. //        $this->view->display_max = $display_max;
  980. //        $this->view->keywords = $keywords;
  981. //        $this->view->categories = $categories;
  982. //        $this->view->brands = $brands;
  983. //        $this->view->descriptions = $descriptions;
  984.         //
  985.         $isMobile $this->mobileDetector->isMobile();
  986.         $this->CommonService->SetPageLayout('item/detail'$isMobile, [], $isMobile 22 2);
  987.         //
  988.         return [
  989.             'searchtext' => $searchtext,
  990.         ];
  991.     }
  992.     private function createGetParamater($getVar$moji "?"$expect ""$and "&"$equal "=")
  993.     {
  994.         $form "";
  995.         $array explode(","$expect);
  996.         while (!is_null($key key($getVar))) {
  997.             if (!in_array($key$array)) {
  998.                 if ($form != "") {
  999.                     //$form .= $and . $key . $equal . urlencode( LmHelper::display_form_text($getVar[$key]) ); 20110104 /の変換処理修正
  1000.                     $form .= $and $key $equal str_replace("%2F""%252F"urlencode(LmHelper::display_form_text($getVar[$key])));
  1001.                     urlencode($getVar[$key]);
  1002.                 } else {
  1003.                     //$form = $moji . $key . $equal . urlencode( LmHelper::display_form_text($getVar[$key]) ); 20110104 /の変換処理修正
  1004.                     $form $moji $key $equal str_replace("%2F""%252F"urlencode(LmHelper::display_form_text($getVar[$key])));
  1005.                 }
  1006.             }
  1007.             next($getVar);
  1008.         }
  1009.         return $form;
  1010.     }
  1011.     public function LM_displayHosokuSetsumei2($data)
  1012.     {
  1013.         // 注文最低ロット
  1014.         if ($data['goods_order_lot'] > 1) {
  1015.             return "ご注文数は、" $data['goods_order_lot'] . "ヶからです。";
  1016.         }
  1017.     }
  1018.     /**
  1019.      * @param int $goodsId
  1020.      * @return string
  1021.      */
  1022.     public static function getMasterCacheKey($goodsId)
  1023.     {
  1024.         //
  1025.         $masterCacheKey "item_index_id_{$goodsId}";
  1026.         //
  1027.         $masterCacheKey str_replace('-''_'$masterCacheKey);
  1028.         //
  1029.         return $masterCacheKey;
  1030.     }
  1031. }