SyntaxErrorException {#1009
  -driverException: PDOException {#1087
    -errorCode: 1064
    -sqlState: "42000"
    #message: """
      SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ', \n
                              sm.url, \n
                              id \n
                      ' at line 140
      """
    #code: "42000"
    #file: "/home/www/front/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php"
    #line: 119
    -previous: PDOException {#1002
      #message: """
        SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ', \n
                                sm.url, \n
                                id \n
                        ' at line 140
        """
      #code: "42000"
      #file: "/home/www/front/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php"
      #line: 117
      +errorInfo: array:3 [
        0 => "42000"
        1 => 1064
        2 => """
          You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ', \n
                                  sm.url, \n
                                  id \n
                          ' at line 140
          """
      ]
      trace: {
        /home/www/front/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117 {try {    return parent::execute($params);} catch (\PDOException $exception) {
          arguments: {
            $bound_input_params: array:7 [ …7]
          }
        }
        /home/www/front/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php:153 {try {    $stmt = $this->stmt->execute($params);} catch (Throwable $ex) {
          arguments: {
            $params: array:7 [ …7]
          }
        }
        /home/www/front/src/Repository/ShopRepository.php:775 {$stmt = $em->prepare($sql);$stmt->execute($params);arguments: {
            $params: array:7 [ …7]
          }
        }
        /home/www/front/src/Controller/Pref/PrefController.php:420 {// 対象店舗抽出$Shops = $this->shopRepository->getBySearch($this->Pref, $area, $type, $menu1, $menu2, $option, $price, $open, $name, $limit, $offset);arguments: {
            $pref: Pref {#941 …}
            $area: array:1 [ …1]
            $type: []
            $menu1: []
            $menu2: []
            $option: []
            $price: []
            $open: null
            $name: null
            $limit: 20
            $offset: 0
          }
        }
        /home/www/front/vendor/symfony/http-kernel/HttpKernel.php:149 {// call controller$response = \call_user_func_array($controller, $arguments);arguments: {
            $request: Request {#4 …}
            $route: "osaka"
          }
        }
        /home/www/front/vendor/symfony/http-kernel/HttpKernel.php:66 {try {    return $this->handleRaw($request, $type);} catch (\Exception $e) {
          arguments: {
            $request: Request {#4 …}
            $type: 1
          }
        }
        /home/www/front/vendor/symfony/http-kernel/Kernel.php:188 {try {    return $this->getHttpKernel()->handle($request, $type, $catch);} finally {
          arguments: {
            $request: Request {#4 …}
            $type: 1
            $catch: true
          }
        }
        /home/www/front/index.php:43 {$request = Request::createFromGlobals();$response = $kernel->handle($request);$response->send();
          arguments: {
            $request: Request {#4 …}
          }
        }
      }
    }
    +errorInfo: array:3 [
      0 => "42000"
      1 => 1064
      2 => """
        You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ', \n
                                sm.url, \n
                                id \n
                        ' at line 140
        """
    ]
    trace: {
      /home/www/front/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:119 {} catch (\PDOException $exception) {    throw new PDOException($exception);}
      }
      /home/www/front/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php:153 {try {    $stmt = $this->stmt->execute($params);} catch (Throwable $ex) {
        arguments: {
          $params: array:7 [ …7]
        }
      }
      /home/www/front/src/Repository/ShopRepository.php:775 {$stmt = $em->prepare($sql);$stmt->execute($params);arguments: {
          $params: array:7 [ …7]
        }
      }
      /home/www/front/src/Controller/Pref/PrefController.php:420 {// 対象店舗抽出$Shops = $this->shopRepository->getBySearch($this->Pref, $area, $type, $menu1, $menu2, $option, $price, $open, $name, $limit, $offset);arguments: {
          $pref: Pref {#941 …}
          $area: array:1 [ …1]
          $type: []
          $menu1: []
          $menu2: []
          $option: []
          $price: []
          $open: null
          $name: null
          $limit: 20
          $offset: 0
        }
      }
      /home/www/front/vendor/symfony/http-kernel/HttpKernel.php:149 {// call controller$response = \call_user_func_array($controller, $arguments);arguments: {
          $request: Request {#4 …}
          $route: "osaka"
        }
      }
      /home/www/front/vendor/symfony/http-kernel/HttpKernel.php:66 {try {    return $this->handleRaw($request, $type);} catch (\Exception $e) {
        arguments: {
          $request: Request {#4 …}
          $type: 1
        }
      }
      /home/www/front/vendor/symfony/http-kernel/Kernel.php:188 {try {    return $this->getHttpKernel()->handle($request, $type, $catch);} finally {
        arguments: {
          $request: Request {#4 …}
          $type: 1
          $catch: true
        }
      }
      /home/www/front/index.php:43 {$request = Request::createFromGlobals();$response = $kernel->handle($request);$response->send();
        arguments: {
          $request: Request {#4 …}
        }
      }
    }
  }
  #message: """
    An exception occurred while executing '\n
            SELECT\n
                s.*,\n
                c.id as category_id,\n
                c.name as category_name,\n
                pa.name as pref_area_name,\n
                CASE WHEN st.count IS NOT NULL THEN st.count\n
                    ELSE 0 END as staff_count,\n
                CASE WHEN wst.count IS NOT NULL THEN wst.count\n
                    ELSE 0 END as working_staff_count,\n
                wtn.is_work_time,\n
                -- 最新クーポン\n
                cp.coupon_id,\n
                cp.coupon_title,\n
                -- 最新速報\n
                ns.news_id,\n
                ns.news_title,\n
                ns.news_datetime,\n
                -- スタッフ\n
                sm.staff_id,\n
                sm.url,\n
                -- 施術\n
                sdp.option_name as shop_default_play,\n
                -- こだわり\n
                sop.option_name as shop_option_play,\n
                soo.option_name as shop_other_option,\n
                sr.point as review_point,\n
                sr.count as review_count\n
            FROM shop s\n
                INNER JOIN category c\n
                    ON s.category_id = c.id\n
                INNER JOIN plan p\n
                    ON s.plan_id = p.id\n
                INNER JOIN pref_area pa\n
                    ON s.pref_area_id = pa.id\n
                LEFT JOIN v_shop_default_play sdp\n
                    ON s.id = sdp.shop_id\n
                LEFT JOIN v_shop_option_play sop\n
                    ON s.id = sop.shop_id\n
                LEFT JOIN v_shop_other_option soo\n
                    ON s.id = soo.shop_id\n
                LEFT JOIN v_shop_review sr\n
                    ON s.id = sr.shop_id\n
                LEFT JOIN (\n
                    SELECT \n
                        c.shop_id, \n
                        c.id as coupon_id, \n
                        c.title as coupon_title\n
                    FROM coupon as c\n
                        INNER JOIN \n
                        (\n
                            SELECT shop_id, MAX(id) as id\n
                            FROM coupon\n
                                INNER JOIN v_business_date v\n
                            WHERE (expire_date IS NULL AND start_date <= v.business_date AND (end_date > v.business_date OR end_date IS NULL))\n
                            OR (expire_date > v.business_date  AND start_date <= v.business_date AND (end_date > v.business_date OR end_date IS NULL))\n
                            AND coupon.status = 1\n
                            AND coupon.active = 1\n
                            GROUP BY shop_id\n
                        ) as mc\n
                        ON mc.id = c.id\n
                        AND c.status = 1\n
                        AND c.active = 1\n
                ) as cp\n
                    ON s.id = cp.shop_id\n
                LEFT JOIN (\n
                    SELECT \n
                        n.shop_id as shop_id,\n
                        n.id as news_id,\n
                        n.title as news_title,\n
                        n.start_date as news_datetime\n
                    FROM news as n\n
                    INNER JOIN (\n
                        SELECT shop_id, MAX(id) as id \n
                        FROM news\n
                        WHERE start_date <= now()\n
                        AND (end_date > now() OR end_date IS NULL) \n
                        AND active = 1\n
                        GROUP BY shop_id\n
                    ) as mn\n
                    ON n.id = mn.id\n
                ) as ns\n
                    ON s.id = ns.shop_id\n
                LEFT JOIN (\n
                    SELECT \n
                        shop_id, \n
                        COUNT(*) as count \n
                    FROM staff \n
                    WHERE active = 1\n
                    AND visible = 0\n
                    GROUP BY shop_id\n
                ) st\n
                    ON s.id = st.shop_id\n
    \n
                LEFT JOIN (\n
                    SELECT \n
                        sh.id as shop_id,\n
                        COUNT(sc.id) as count\n
                    FROM staff_schedule as sc\n
                        INNER JOIN staff s\n
                            ON sc.staff_id = s.id\n
                            AND s.active = 1\n
                            AND s.visible = 0\n
                        INNER JOIN v_business_date bd\n
                            ON bd.business_date = sc.date\n
                        INNER JOIN shop as sh\n
                            ON s.shop_id = sh.id\n
                            AND sh.start_datetime <= ?\n
                            AND (sh.end_datetime >= ? or sh.end_datetime is null)\n
                    WHERE 1 = 1\n
                    AND (\n
                    (\n
                        sc.start_time IS NULL AND \n
                        sc.end_time IS NULL AND \n
                        sc.note IS NOT NULL\n
                    ) OR (\n
                        sc.start_time IS NOT NULL AND \n
                        sc.end_time IS NOT NULL AND \n
                        sc.start_time <= CONCAT(bd.business_date, ' ', bd.business_hour) AND\n
                        sc.end_time > CONCAT(bd.business_date, ' ', bd.business_hour)\n
                    ) OR (\n
                        sc.start_time IS NULL AND \n
                        sc.end_time IS NOT NULL AND \n
                        sc.end_time > CONCAT(bd.business_date, ' ', bd.business_hour)\n
                    ) OR (\n
                        sc.start_time IS NOT NULL AND \n
                        sc.end_time IS NULL AND \n
                        sc.start_time <= CONCAT(bd.business_date, ' ', bd.business_hour)\n
                    ))\n
                    GROUP BY sh.id \n
                ) wst\n
                    ON s.id = wst.shop_id\n
                LEFT JOIN (\n
                    SELECT \n
                        shop_id AS shop_id,\n
                        GROUP_CONCAT(id ORDER BY s.rank ASC SEPARATOR ',') AS staff_id,\n
                        GROUP_CONCAT(url ORDER BY s.rank ASC SEPARATOR ',') AS url\n
                    FROM (\n
                        SELECT \n
                            shop_id, \n
                            rank, \n
                            sm.url, \n
                            id \n
                        FROM staff \n
                            LEFT JOIN \n
                                (SELECT \n
                                    staff_id, \n
                                    CASE WHEN url IS NOT NULL THEN\n
                                        CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(url, '/', 8), '/', 8), '/thumb/', SUBSTRING_INDEX(SUBSTRING_INDEX(url, '/', 9), '/', -1))\n
                                    ELSE null END  as url \n
                                FROM staff_image \n
                                WHERE rank = 1) as sm \n
                            ON staff.id = sm.staff_id \n
                        WHERE active = 1 \n
                        AND visible = 0 \n
                        GROUP BY shop_id, sm.url, rank \n
                    ) as s\n
                    GROUP BY s.shop_id\n
                ) as sm\n
                    ON s.id = sm.shop_id\n
                INNER JOIN v_shop_work_time_now wtn\n
                    ON s.id = wtn.id\n
    \n
            WHERE s.active = ?\n
            AND s.start_datetime <= ?\n
            AND (s.end_datetime >= ? or s.end_datetime is null)  \n
           AND s.pref_id = ?  AND s.id IN (SELECT shop_id FROM shop_pref_area WHERE  pref_area_id IN (?)) ORDER BY s.updated DESC  LIMIT 20 OFFSET 0' with params ["2026-08-29 01:38:29", "2026-08-29 01:38:29", 1, "2026-08-29 01:38:29", "2026-08-29 01:38:29", 27, "11"]:\n
    \n
    SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ', \n
                            sm.url, \n
                            id \n
                    ' at line 140
    """
  #code: 0
  #file: "/home/www/front/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php"
  #line: 79
  -previous: PDOException {#1087}
  trace: {
    /home/www/front/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:79 {case '1626':    return new Exception\SyntaxErrorException($message, $exception);}
    /home/www/front/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:169 {if ($driver instanceof ExceptionConverterDriver && $driverEx instanceof DriverExceptionInterface) {    return $driver->convertException($msg, $driverEx);}
      arguments: {
        $message: """
          An exception occurred while executing '\n
                  SELECT\n
                      s.*,\n
                      c.id as category_id,\n
                      c.name as category_name,\n
                      pa.name as pref_area_name,\n
                      CASE WHEN st.count IS NOT NULL THEN st.count\n
                          ELSE 0 END as staff_count,\n
                      CASE WHEN wst.count IS NOT NULL THEN wst.count\n
                          ELSE 0 END as working_staff_count,\n
                      wtn.is_work_time,\n
                      -- 最新クーポン\n
                      cp.coupon_id,\n
                      cp.coupon_title,\n
                      -- 最新速報\n
                      ns.news_id,\n
                      ns.news_title,\n
                      ns.news_datetime,\n
                      -- スタッフ\n
                      sm.staff_id,\n
                      sm.url,\n
                      -- 施術\n
                      sdp.option_name as shop_default_play,\n
                      -- こだわり\n
                      sop.option_name as shop_option_play,\n
                      soo.option_name as shop_other_option,\n
                      sr.point as review_point,\n
                      sr.count as review_count\n
                  FROM shop s\n
                      INNER JOIN category c\n
                          ON s.category_id = c.id\n
                      INNER JOIN plan p\n
                          ON s.plan_id = p.id\n
                      INNER JOIN pref_area pa\n
                          ON s.pref_area_id = pa.id\n
                      LEFT JOIN v_shop_default_play sdp\n
                          ON s.id = sdp.shop_id\n
                      LEFT JOIN v_shop_option_play sop\n
                          ON s.id = sop.shop_id\n
                      LEFT JOIN v_shop_other_option soo\n
                          ON s.id = soo.shop_id\n
                      LEFT JOIN v_shop_review sr\n
                          ON s.id = sr.shop_id\n
                      LEFT JOIN (\n
                          SELECT \n
                              c.shop_id, \n
                              c.id as coupon_id, \n
                              c.title as coupon_title\n
                          FROM coupon as c\n
                              INNER JOIN \n
                              (\n
                                  SELECT shop_id, MAX(id) as id\n
                                  FROM coupon\n
                                      INNER JOIN v_business_date v\n
                                  WHERE (expire_date IS NULL AND start_date <= v.business_date AND (end_date > v.business_date OR end_date IS NULL))\n
                                  OR (expire_date > v.business_date  AND start_date <= v.business_date AND (end_date > v.business_date OR end_date IS NULL))\n
                                  AND coupon.status = 1\n
                                  AND coupon.active = 1\n
                                  GROUP BY shop_id\n
                              ) as mc\n
                              ON mc.id = c.id\n
                              AND c.status = 1\n
                              AND c.active = 1\n
                      ) as cp\n
                          ON s.id = cp.shop_id\n
                      LEFT JOIN (\n
                          SELECT \n
                              n.shop_id as shop_id,\n
                              n.id as news_id,\n
                              n.title as news_title,\n
                              n.start_date as news_datetime\n
                          FROM news as n\n
                          INNER JOIN (\n
                              SELECT shop_id, MAX(id) as id \n
                              FROM news\n
                              WHERE start_date <= now()\n
                              AND (end_date > now() OR end_date IS NULL) \n
                              AND active = 1\n
                              GROUP BY shop_id\n
                          ) as mn\n
                          ON n.id = mn.id\n
                      ) as ns\n
                          ON s.id = ns.shop_id\n
                      LEFT JOIN (\n
                          SELECT \n
                              shop_id, \n
                              COUNT(*) as count \n
                          FROM staff \n
                          WHERE active = 1\n
                          AND visible = 0\n
                          GROUP BY shop_id\n
                      ) st\n
                          ON s.id = st.shop_id\n
          \n
                      LEFT JOIN (\n
                          SELECT \n
                              sh.id as shop_id,\n
                              COUNT(sc.id) as count\n
                          FROM staff_schedule as sc\n
                              INNER JOIN staff s\n
                                  ON sc.staff_id = s.id\n
                                  AND s.active = 1\n
                                  AND s.visible = 0\n
                              INNER JOIN v_business_date bd\n
                                  ON bd.business_date = sc.date\n
                              INNER JOIN shop as sh\n
                                  ON s.shop_id = sh.id\n
                                  AND sh.start_datetime <= ?\n
                                  AND (sh.end_datetime >= ? or sh.end_datetime is null)\n
                          WHERE 1 = 1\n
                          AND (\n
                          (\n
                              sc.start_time IS NULL AND \n
                              sc.end_time IS NULL AND \n
                              sc.note IS NOT NULL\n
                          ) OR (\n
                              sc.start_time IS NOT NULL AND \n
                              sc.end_time IS NOT NULL AND \n
                              sc.start_time <= CONCAT(bd.business_date, ' ', bd.business_hour) AND\n
                              sc.end_time > CONCAT(bd.business_date, ' ', bd.business_hour)\n
                          ) OR (\n
                              sc.start_time IS NULL AND \n
                              sc.end_time IS NOT NULL AND \n
                              sc.end_time > CONCAT(bd.business_date, ' ', bd.business_hour)\n
                          ) OR (\n
                              sc.start_time IS NOT NULL AND \n
                              sc.end_time IS NULL AND \n
                              sc.start_time <= CONCAT(bd.business_date, ' ', bd.business_hour)\n
                          ))\n
                          GROUP BY sh.id \n
                      ) wst\n
                          ON s.id = wst.shop_id\n
                      LEFT JOIN (\n
                          SELECT \n
                              shop_id AS shop_id,\n
                              GROUP_CONCAT(id ORDER BY s.rank ASC SEPARATOR ',') AS staff_id,\n
                              GROUP_CONCAT(url ORDER BY s.rank ASC SEPARATOR ',') AS url\n
                          FROM (\n
                              SELECT \n
                                  shop_id, \n
                                  rank, \n
                                  sm.url, \n
                                  id \n
                              FROM staff \n
                                  LEFT JOIN \n
                                      (SELECT \n
                                          staff_id, \n
                                          CASE WHEN url IS NOT NULL THEN\n
                                              CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(url, '/', 8), '/', 8), '/thumb/', SUBSTRING_INDEX(SUBSTRING_INDEX(url, '/', 9), '/', -1))\n
                                          ELSE null END  as url \n
                                      FROM staff_image \n
                                      WHERE rank = 1) as sm \n
                                  ON staff.id = sm.staff_id \n
                              WHERE active = 1 \n
                              AND visible = 0 \n
                              GROUP BY shop_id, sm.url, rank \n
                          ) as s\n
                          GROUP BY s.shop_id\n
                      ) as sm\n
                          ON s.id = sm.shop_id\n
                      INNER JOIN v_shop_work_time_now wtn\n
                          ON s.id = wtn.id\n
          \n
                  WHERE s.active = ?\n
                  AND s.start_datetime <= ?\n
                  AND (s.end_datetime >= ? or s.end_datetime is null)  \n
                 AND s.pref_id = ?  AND s.id IN (SELECT shop_id FROM shop_pref_area WHERE  pref_area_id IN (?)) ORDER BY s.updated DESC  LIMIT 20 OFFSET 0' with params ["2026-08-29 01:38:29", "2026-08-29 01:38:29", 1, "2026-08-29 01:38:29", "2026-08-29 01:38:29", 27, "11"]:\n
          \n
          SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ', \n
                                  sm.url, \n
                                  id \n
                          ' at line 140
          """
        $exception: PDOException {#1087}
      }
    }
    /home/www/front/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:145 {
      › 
      ›     return static::wrapException($driver, $driverEx, $msg);}
      arguments: {
        $driver: Driver {#259 …}
        $driverEx: PDOException {#1087}
        $msg: """
          An exception occurred while executing '\n
                  SELECT\n
                      s.*,\n
                      c.id as category_id,\n
                      c.name as category_name,\n
                      pa.name as pref_area_name,\n
                      CASE WHEN st.count IS NOT NULL THEN st.count\n
                          ELSE 0 END as staff_count,\n
                      CASE WHEN wst.count IS NOT NULL THEN wst.count\n
                          ELSE 0 END as working_staff_count,\n
                      wtn.is_work_time,\n
                      -- 最新クーポン\n
                      cp.coupon_id,\n
                      cp.coupon_title,\n
                      -- 最新速報\n
                      ns.news_id,\n
                      ns.news_title,\n
                      ns.news_datetime,\n
                      -- スタッフ\n
                      sm.staff_id,\n
                      sm.url,\n
                      -- 施術\n
                      sdp.option_name as shop_default_play,\n
                      -- こだわり\n
                      sop.option_name as shop_option_play,\n
                      soo.option_name as shop_other_option,\n
                      sr.point as review_point,\n
                      sr.count as review_count\n
                  FROM shop s\n
                      INNER JOIN category c\n
                          ON s.category_id = c.id\n
                      INNER JOIN plan p\n
                          ON s.plan_id = p.id\n
                      INNER JOIN pref_area pa\n
                          ON s.pref_area_id = pa.id\n
                      LEFT JOIN v_shop_default_play sdp\n
                          ON s.id = sdp.shop_id\n
                      LEFT JOIN v_shop_option_play sop\n
                          ON s.id = sop.shop_id\n
                      LEFT JOIN v_shop_other_option soo\n
                          ON s.id = soo.shop_id\n
                      LEFT JOIN v_shop_review sr\n
                          ON s.id = sr.shop_id\n
                      LEFT JOIN (\n
                          SELECT \n
                              c.shop_id, \n
                              c.id as coupon_id, \n
                              c.title as coupon_title\n
                          FROM coupon as c\n
                              INNER JOIN \n
                              (\n
                                  SELECT shop_id, MAX(id) as id\n
                                  FROM coupon\n
                                      INNER JOIN v_business_date v\n
                                  WHERE (expire_date IS NULL AND start_date <= v.business_date AND (end_date > v.business_date OR end_date IS NULL))\n
                                  OR (expire_date > v.business_date  AND start_date <= v.business_date AND (end_date > v.business_date OR end_date IS NULL))\n
                                  AND coupon.status = 1\n
                                  AND coupon.active = 1\n
                                  GROUP BY shop_id\n
                              ) as mc\n
                              ON mc.id = c.id\n
                              AND c.status = 1\n
                              AND c.active = 1\n
                      ) as cp\n
                          ON s.id = cp.shop_id\n
                      LEFT JOIN (\n
                          SELECT \n
                              n.shop_id as shop_id,\n
                              n.id as news_id,\n
                              n.title as news_title,\n
                              n.start_date as news_datetime\n
                          FROM news as n\n
                          INNER JOIN (\n
                              SELECT shop_id, MAX(id) as id \n
                              FROM news\n
                              WHERE start_date <= now()\n
                              AND (end_date > now() OR end_date IS NULL) \n
                              AND active = 1\n
                              GROUP BY shop_id\n
                          ) as mn\n
                          ON n.id = mn.id\n
                      ) as ns\n
                          ON s.id = ns.shop_id\n
                      LEFT JOIN (\n
                          SELECT \n
                              shop_id, \n
                              COUNT(*) as count \n
                          FROM staff \n
                          WHERE active = 1\n
                          AND visible = 0\n
                          GROUP BY shop_id\n
                      ) st\n
                          ON s.id = st.shop_id\n
          \n
                      LEFT JOIN (\n
                          SELECT \n
                              sh.id as shop_id,\n
                              COUNT(sc.id) as count\n
                          FROM staff_schedule as sc\n
                              INNER JOIN staff s\n
                                  ON sc.staff_id = s.id\n
                                  AND s.active = 1\n
                                  AND s.visible = 0\n
                              INNER JOIN v_business_date bd\n
                                  ON bd.business_date = sc.date\n
                              INNER JOIN shop as sh\n
                                  ON s.shop_id = sh.id\n
                                  AND sh.start_datetime <= ?\n
                                  AND (sh.end_datetime >= ? or sh.end_datetime is null)\n
                          WHERE 1 = 1\n
                          AND (\n
                          (\n
                              sc.start_time IS NULL AND \n
                              sc.end_time IS NULL AND \n
                              sc.note IS NOT NULL\n
                          ) OR (\n
                              sc.start_time IS NOT NULL AND \n
                              sc.end_time IS NOT NULL AND \n
                              sc.start_time <= CONCAT(bd.business_date, ' ', bd.business_hour) AND\n
                              sc.end_time > CONCAT(bd.business_date, ' ', bd.business_hour)\n
                          ) OR (\n
                              sc.start_time IS NULL AND \n
                              sc.end_time IS NOT NULL AND \n
                              sc.end_time > CONCAT(bd.business_date, ' ', bd.business_hour)\n
                          ) OR (\n
                              sc.start_time IS NOT NULL AND \n
                              sc.end_time IS NULL AND \n
                              sc.start_time <= CONCAT(bd.business_date, ' ', bd.business_hour)\n
                          ))\n
                          GROUP BY sh.id \n
                      ) wst\n
                          ON s.id = wst.shop_id\n
                      LEFT JOIN (\n
                          SELECT \n
                              shop_id AS shop_id,\n
                              GROUP_CONCAT(id ORDER BY s.rank ASC SEPARATOR ',') AS staff_id,\n
                              GROUP_CONCAT(url ORDER BY s.rank ASC SEPARATOR ',') AS url\n
                          FROM (\n
                              SELECT \n
                                  shop_id, \n
                                  rank, \n
                                  sm.url, \n
                                  id \n
                              FROM staff \n
                                  LEFT JOIN \n
                                      (SELECT \n
                                          staff_id, \n
                                          CASE WHEN url IS NOT NULL THEN\n
                                              CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(url, '/', 8), '/', 8), '/thumb/', SUBSTRING_INDEX(SUBSTRING_INDEX(url, '/', 9), '/', -1))\n
                                          ELSE null END  as url \n
                                      FROM staff_image \n
                                      WHERE rank = 1) as sm \n
                                  ON staff.id = sm.staff_id \n
                              WHERE active = 1 \n
                              AND visible = 0 \n
                              GROUP BY shop_id, sm.url, rank \n
                          ) as s\n
                          GROUP BY s.shop_id\n
                      ) as sm\n
                          ON s.id = sm.shop_id\n
                      INNER JOIN v_shop_work_time_now wtn\n
                          ON s.id = wtn.id\n
          \n
                  WHERE s.active = ?\n
                  AND s.start_datetime <= ?\n
                  AND (s.end_datetime >= ? or s.end_datetime is null)  \n
                 AND s.pref_id = ?  AND s.id IN (SELECT shop_id FROM shop_pref_area WHERE  pref_area_id IN (?)) ORDER BY s.updated DESC  LIMIT 20 OFFSET 0' with params ["2026-08-29 01:38:29", "2026-08-29 01:38:29", 1, "2026-08-29 01:38:29", "2026-08-29 01:38:29", 27, "11"]:\n
          \n
          SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ', \n
                                  sm.url, \n
                                  id \n
                          ' at line 140
          """
      }
    }
    /home/www/front/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php:162 {    $this->sql,    $this->conn->resolveParams($this->params, $this->types));
      arguments: {
        $driver: Driver {#259 …}
        $driverEx: PDOException {#1087}
        $sql: """
          \n
                  SELECT\n
                      s.*,\n
                      c.id as category_id,\n
                      c.name as category_name,\n
                      pa.name as pref_area_name,\n
                      CASE WHEN st.count IS NOT NULL THEN st.count\n
                          ELSE 0 END as staff_count,\n
                      CASE WHEN wst.count IS NOT NULL THEN wst.count\n
                          ELSE 0 END as working_staff_count,\n
                      wtn.is_work_time,\n
                      -- 最新クーポン\n
                      cp.coupon_id,\n
                      cp.coupon_title,\n
                      -- 最新速報\n
                      ns.news_id,\n
                      ns.news_title,\n
                      ns.news_datetime,\n
                      -- スタッフ\n
                      sm.staff_id,\n
                      sm.url,\n
                      -- 施術\n
                      sdp.option_name as shop_default_play,\n
                      -- こだわり\n
                      sop.option_name as shop_option_play,\n
                      soo.option_name as shop_other_option,\n
                      sr.point as review_point,\n
                      sr.count as review_count\n
                  FROM shop s\n
                      INNER JOIN category c\n
                          ON s.category_id = c.id\n
                      INNER JOIN plan p\n
                          ON s.plan_id = p.id\n
                      INNER JOIN pref_area pa\n
                          ON s.pref_area_id = pa.id\n
                      LEFT JOIN v_shop_default_play sdp\n
                          ON s.id = sdp.shop_id\n
                      LEFT JOIN v_shop_option_play sop\n
                          ON s.id = sop.shop_id\n
                      LEFT JOIN v_shop_other_option soo\n
                          ON s.id = soo.shop_id\n
                      LEFT JOIN v_shop_review sr\n
                          ON s.id = sr.shop_id\n
                      LEFT JOIN (\n
                          SELECT \n
                              c.shop_id, \n
                              c.id as coupon_id, \n
                              c.title as coupon_title\n
                          FROM coupon as c\n
                              INNER JOIN \n
                              (\n
                                  SELECT shop_id, MAX(id) as id\n
                                  FROM coupon\n
                                      INNER JOIN v_business_date v\n
                                  WHERE (expire_date IS NULL AND start_date <= v.business_date AND (end_date > v.business_date OR end_date IS NULL))\n
                                  OR (expire_date > v.business_date  AND start_date <= v.business_date AND (end_date > v.business_date OR end_date IS NULL))\n
                                  AND coupon.status = 1\n
                                  AND coupon.active = 1\n
                                  GROUP BY shop_id\n
                              ) as mc\n
                              ON mc.id = c.id\n
                              AND c.status = 1\n
                              AND c.active = 1\n
                      ) as cp\n
                          ON s.id = cp.shop_id\n
                      LEFT JOIN (\n
                          SELECT \n
                              n.shop_id as shop_id,\n
                              n.id as news_id,\n
                              n.title as news_title,\n
                              n.start_date as news_datetime\n
                          FROM news as n\n
                          INNER JOIN (\n
                              SELECT shop_id, MAX(id) as id \n
                              FROM news\n
                              WHERE start_date <= now()\n
                              AND (end_date > now() OR end_date IS NULL) \n
                              AND active = 1\n
                              GROUP BY shop_id\n
                          ) as mn\n
                          ON n.id = mn.id\n
                      ) as ns\n
                          ON s.id = ns.shop_id\n
                      LEFT JOIN (\n
                          SELECT \n
                              shop_id, \n
                              COUNT(*) as count \n
                          FROM staff \n
                          WHERE active = 1\n
                          AND visible = 0\n
                          GROUP BY shop_id\n
                      ) st\n
                          ON s.id = st.shop_id\n
          \n
                      LEFT JOIN (\n
                          SELECT \n
                              sh.id as shop_id,\n
                              COUNT(sc.id) as count\n
                          FROM staff_schedule as sc\n
                              INNER JOIN staff s\n
                                  ON sc.staff_id = s.id\n
                                  AND s.active = 1\n
                                  AND s.visible = 0\n
                              INNER JOIN v_business_date bd\n
                                  ON bd.business_date = sc.date\n
                              INNER JOIN shop as sh\n
                                  ON s.shop_id = sh.id\n
                                  AND sh.start_datetime <= ?\n
                                  AND (sh.end_datetime >= ? or sh.end_datetime is null)\n
                          WHERE 1 = 1\n
                          AND (\n
                          (\n
                              sc.start_time IS NULL AND \n
                              sc.end_time IS NULL AND \n
                              sc.note IS NOT NULL\n
                          ) OR (\n
                              sc.start_time IS NOT NULL AND \n
                              sc.end_time IS NOT NULL AND \n
                              sc.start_time <= CONCAT(bd.business_date, ' ', bd.business_hour) AND\n
                              sc.end_time > CONCAT(bd.business_date, ' ', bd.business_hour)\n
                          ) OR (\n
                              sc.start_time IS NULL AND \n
                              sc.end_time IS NOT NULL AND \n
                              sc.end_time > CONCAT(bd.business_date, ' ', bd.business_hour)\n
                          ) OR (\n
                              sc.start_time IS NOT NULL AND \n
                              sc.end_time IS NULL AND \n
                              sc.start_time <= CONCAT(bd.business_date, ' ', bd.business_hour)\n
                          ))\n
                          GROUP BY sh.id \n
                      ) wst\n
                          ON s.id = wst.shop_id\n
                      LEFT JOIN (\n
                          SELECT \n
                              shop_id AS shop_id,\n
                              GROUP_CONCAT(id ORDER BY s.rank ASC SEPARATOR ',') AS staff_id,\n
                              GROUP_CONCAT(url ORDER BY s.rank ASC SEPARATOR ',') AS url\n
                          FROM (\n
                              SELECT \n
                                  shop_id, \n
                                  rank, \n
                                  sm.url, \n
                                  id \n
                              FROM staff \n
                                  LEFT JOIN \n
                                      (SELECT \n
                                          staff_id, \n
                                          CASE WHEN url IS NOT NULL THEN\n
                                              CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(url, '/', 8), '/', 8), '/thumb/', SUBSTRING_INDEX(SUBSTRING_INDEX(url, '/', 9), '/', -1))\n
                                          ELSE null END  as url \n
                                      FROM staff_image \n
                                      WHERE rank = 1) as sm \n
                                  ON staff.id = sm.staff_id \n
                              WHERE active = 1 \n
                              AND visible = 0 \n
                              GROUP BY shop_id, sm.url, rank \n
                          ) as s\n
                          GROUP BY s.shop_id\n
                      ) as sm\n
                          ON s.id = sm.shop_id\n
                      INNER JOIN v_shop_work_time_now wtn\n
                          ON s.id = wtn.id\n
          \n
                  WHERE s.active = ?\n
                  AND s.start_datetime <= ?\n
                  AND (s.end_datetime >= ? or s.end_datetime is null)  \n
                 AND s.pref_id = ?  AND s.id IN (SELECT shop_id FROM shop_pref_area WHERE  pref_area_id IN (?)) ORDER BY s.updated DESC  LIMIT 20 OFFSET 0
          """
        $params: array:7 [ …7]
      }
    }
    /home/www/front/src/Repository/ShopRepository.php:775 {$stmt = $em->prepare($sql);$stmt->execute($params);arguments: {
        $params: array:7 [ …7]
      }
    }
    /home/www/front/src/Controller/Pref/PrefController.php:420 {// 対象店舗抽出$Shops = $this->shopRepository->getBySearch($this->Pref, $area, $type, $menu1, $menu2, $option, $price, $open, $name, $limit, $offset);arguments: {
        $pref: Pref {#941 …}
        $area: array:1 [ …1]
        $type: []
        $menu1: []
        $menu2: []
        $option: []
        $price: []
        $open: null
        $name: null
        $limit: 20
        $offset: 0
      }
    }
    /home/www/front/vendor/symfony/http-kernel/HttpKernel.php:149 {// call controller$response = \call_user_func_array($controller, $arguments);arguments: {
        $request: Request {#4 …}
        $route: "osaka"
      }
    }
    /home/www/front/vendor/symfony/http-kernel/HttpKernel.php:66 {try {    return $this->handleRaw($request, $type);} catch (\Exception $e) {
      arguments: {
        $request: Request {#4 …}
        $type: 1
      }
    }
    /home/www/front/vendor/symfony/http-kernel/Kernel.php:188 {try {    return $this->getHttpKernel()->handle($request, $type, $catch);} finally {
      arguments: {
        $request: Request {#4 …}
        $type: 1
        $catch: true
      }
    }
    /home/www/front/index.php:43 {$request = Request::createFromGlobals();$response = $kernel->handle($request);$response->send();
      arguments: {
        $request: Request {#4 …}
      }
    }
  }
}