SyntaxErrorException {#1023
  -driverException: PDOException {#1077
    -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 143
      """
    #code: "42000"
    #file: "/home/www/front/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php"
    #line: 119
    -previous: PDOException {#1031
      #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 143
        """
      #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 143
          """
      ]
      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:14 [ …14]
          }
        }
        /home/www/front/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php:153 {try {    $stmt = $this->stmt->execute($params);} catch (Throwable $ex) {
          arguments: {
            $params: array:14 [ …14]
          }
        }
        /home/www/front/src/Repository/PvRepository.php:1731 {$stmt = $em->prepare($sql);$stmt->execute($params);arguments: {
            $params: array:14 [ …14]
          }
        }
        /home/www/front/src/Controller/Pref/PrefController.php:2130 {// 総合$Shops = $this->pvRepository->getShopRanking($this->Pref, $from, $to, $area_id, $service_id, false, false, 100);arguments: {
            $pref: Pref {#959 …}
            $from: "2026-08-24"
            $to: "2026-08-31"
            $pref_area: null
            $service: "12"
            $is_new: false
            $new_period: false
            $limit: 100
          }
        }
        /home/www/front/vendor/symfony/http-kernel/HttpKernel.php:149 {// call controller$response = \call_user_func_array($controller, $arguments);arguments: {
            $request: Request {#4 …}
            $route: "kochi"
            $area_id: null
            $service_id: "12"
          }
        }
        /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 143
        """
    ]
    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:14 [ …14]
        }
      }
      /home/www/front/src/Repository/PvRepository.php:1731 {$stmt = $em->prepare($sql);$stmt->execute($params);arguments: {
          $params: array:14 [ …14]
        }
      }
      /home/www/front/src/Controller/Pref/PrefController.php:2130 {// 総合$Shops = $this->pvRepository->getShopRanking($this->Pref, $from, $to, $area_id, $service_id, false, false, 100);arguments: {
          $pref: Pref {#959 …}
          $from: "2026-08-24"
          $to: "2026-08-31"
          $pref_area: null
          $service: "12"
          $is_new: false
          $new_period: false
          $limit: 100
        }
      }
      /home/www/front/vendor/symfony/http-kernel/HttpKernel.php:149 {// call controller$response = \call_user_func_array($controller, $arguments);arguments: {
          $request: Request {#4 …}
          $route: "kochi"
          $area_id: null
          $service_id: "12"
        }
      }
      /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
                rnk.point as point,\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.active = 1\n
                            AND coupon.status = 1\n
                            GROUP BY shop_id\n
                        ) as mc\n
                        ON mc.id = c.id\n
                        AND c.active = 1\n
                        AND c.status = 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.created as news_datetime\n
                    FROM news as n\n
                    INNER JOIN (\n
                        SELECT shop_id, id \n
                        FROM news\n
                            INNER JOIN v_business_date as v\n
                        WHERE start_date <= v.business_date \n
                        AND (end_date > v.business_date OR end_date IS NULL) \n
                        AND active = 1\n
                        GROUP BY shop_id\n
                        HAVING MAX(news.created)\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 WHERE active = 1 AND visible = 0 AND rank <= 3 GROUP BY shop_id, sm.url, rank ) 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
                INNER JOIN (\n
                        SELECT\n
                            shop_id as shop_id,\n
                            SUM(point) as point\n
                        FROM (\n
                            SELECT\n
                                distinct  \n
                                date_format(pv.date, '%Y-%m-%d') as date,\n
                                pv.pref_id, \n
                                s.pref_area_id, \n
                                pv.shop_id, \n
                                pv.addr,\n
                                pv.type,\n
                                CASE \n
                                    WHEN pv.type = 1 THEN 1\n
                                    WHEN pv.type = 2 THEN 1\n
                                    WHEN pv.type = 3 THEN 1\n
                                END point\n
                            FROM pv_shop_new as pv\n
                            INNER JOIN shop s \n
                                ON s.id = pv.shop_id\n
                                AND s.active = 1\n
                            INNER JOIN shop_default_play sd\n
                                ON s.id = sd.shop_id\n
                                AND sd.system_option_id = ?\n
                            WHERE pv.pref_id = ?\n
                            AND pv.date >= ?\n
                            AND pv.date <= ?\n
                            GROUP BY \n
                                date_format(pv.date, '%Y-%m-%d'),\n
                                pv.pref_id, \n
                                s.pref_area_id, \n
                                pv.shop_id, \n
                                pv.addr,\n
                                pv.type\n
    \n
                            UNION ALL\n
    \n
                            SELECT\n
                                distinct  \n
                                date_format(op.date, '%Y-%m-%d') as date,\n
                                op.pref_id, \n
                                s.pref_area_id, \n
                                op.shop_id, \n
                                'admin',\n
                                op.type,\n
                                CASE \n
                                    WHEN op.type = 1 THEN 5\n
                                    WHEN op.type = 2 THEN 10\n
                                    WHEN op.type = 3 THEN 5\n
                                END point\n
                            FROM op_shop as op\n
                            INNER JOIN shop s \n
                                ON s.id = op.shop_id\n
                                AND s.active = 1\n
                            INNER JOIN shop_default_play sd\n
                                ON s.id = sd.shop_id\n
                                AND sd.system_option_id = ?\n
                            WHERE op.pref_id = ?\n
                            AND op.date >= ?\n
                            AND op.date <= ?\n
                            GROUP BY \n
                                date_format(op.date, '%Y-%m-%d'),\n
                                op.pref_id, \n
                                s.pref_area_id, \n
                                op.shop_id, \n
                                op.type\n
                        ) as point\n
                        GROUP BY\n
                            shop_id\n
                    ) rnk\n
                    ON s.id = rnk.shop_id\n
            WHERE s.active = ?\n
            AND s.pref_id = ?\n
            AND s.start_datetime <= ?\n
            AND (s.end_datetime >= ? or s.end_datetime is null) \n
            ORDER BY rnk.point DESC\n
            LIMIT 100\n
          ' with params ["2026-08-31 17:35:53", "2026-08-31 17:35:53", "12", 39, "2026-08-24 00:00:00", "2026-08-31 23:59:59", "12", 39, "2026-08-24 00:00:00", "2026-08-31 23:59:59", 1, 39, "2026-08-31 17:35:53", "2026-08-31 17:35:53"]:\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 143
    """
  #code: 0
  #file: "/home/www/front/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php"
  #line: 79
  -previous: PDOException {#1077}
  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
                      rnk.point as point,\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.active = 1\n
                                  AND coupon.status = 1\n
                                  GROUP BY shop_id\n
                              ) as mc\n
                              ON mc.id = c.id\n
                              AND c.active = 1\n
                              AND c.status = 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.created as news_datetime\n
                          FROM news as n\n
                          INNER JOIN (\n
                              SELECT shop_id, id \n
                              FROM news\n
                                  INNER JOIN v_business_date as v\n
                              WHERE start_date <= v.business_date \n
                              AND (end_date > v.business_date OR end_date IS NULL) \n
                              AND active = 1\n
                              GROUP BY shop_id\n
                              HAVING MAX(news.created)\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 WHERE active = 1 AND visible = 0 AND rank <= 3 GROUP BY shop_id, sm.url, rank ) 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
                      INNER JOIN (\n
                              SELECT\n
                                  shop_id as shop_id,\n
                                  SUM(point) as point\n
                              FROM (\n
                                  SELECT\n
                                      distinct  \n
                                      date_format(pv.date, '%Y-%m-%d') as date,\n
                                      pv.pref_id, \n
                                      s.pref_area_id, \n
                                      pv.shop_id, \n
                                      pv.addr,\n
                                      pv.type,\n
                                      CASE \n
                                          WHEN pv.type = 1 THEN 1\n
                                          WHEN pv.type = 2 THEN 1\n
                                          WHEN pv.type = 3 THEN 1\n
                                      END point\n
                                  FROM pv_shop_new as pv\n
                                  INNER JOIN shop s \n
                                      ON s.id = pv.shop_id\n
                                      AND s.active = 1\n
                                  INNER JOIN shop_default_play sd\n
                                      ON s.id = sd.shop_id\n
                                      AND sd.system_option_id = ?\n
                                  WHERE pv.pref_id = ?\n
                                  AND pv.date >= ?\n
                                  AND pv.date <= ?\n
                                  GROUP BY \n
                                      date_format(pv.date, '%Y-%m-%d'),\n
                                      pv.pref_id, \n
                                      s.pref_area_id, \n
                                      pv.shop_id, \n
                                      pv.addr,\n
                                      pv.type\n
          \n
                                  UNION ALL\n
          \n
                                  SELECT\n
                                      distinct  \n
                                      date_format(op.date, '%Y-%m-%d') as date,\n
                                      op.pref_id, \n
                                      s.pref_area_id, \n
                                      op.shop_id, \n
                                      'admin',\n
                                      op.type,\n
                                      CASE \n
                                          WHEN op.type = 1 THEN 5\n
                                          WHEN op.type = 2 THEN 10\n
                                          WHEN op.type = 3 THEN 5\n
                                      END point\n
                                  FROM op_shop as op\n
                                  INNER JOIN shop s \n
                                      ON s.id = op.shop_id\n
                                      AND s.active = 1\n
                                  INNER JOIN shop_default_play sd\n
                                      ON s.id = sd.shop_id\n
                                      AND sd.system_option_id = ?\n
                                  WHERE op.pref_id = ?\n
                                  AND op.date >= ?\n
                                  AND op.date <= ?\n
                                  GROUP BY \n
                                      date_format(op.date, '%Y-%m-%d'),\n
                                      op.pref_id, \n
                                      s.pref_area_id, \n
                                      op.shop_id, \n
                                      op.type\n
                              ) as point\n
                              GROUP BY\n
                                  shop_id\n
                          ) rnk\n
                          ON s.id = rnk.shop_id\n
                  WHERE s.active = ?\n
                  AND s.pref_id = ?\n
                  AND s.start_datetime <= ?\n
                  AND (s.end_datetime >= ? or s.end_datetime is null) \n
                  ORDER BY rnk.point DESC\n
                  LIMIT 100\n
                ' with params ["2026-08-31 17:35:53", "2026-08-31 17:35:53", "12", 39, "2026-08-24 00:00:00", "2026-08-31 23:59:59", "12", 39, "2026-08-24 00:00:00", "2026-08-31 23:59:59", 1, 39, "2026-08-31 17:35:53", "2026-08-31 17:35:53"]:\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 143
          """
        $exception: PDOException {#1077}
      }
    }
    /home/www/front/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:145 {
      › 
      ›     return static::wrapException($driver, $driverEx, $msg);}
      arguments: {
        $driver: Driver {#259 …}
        $driverEx: PDOException {#1077}
        $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
                      rnk.point as point,\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.active = 1\n
                                  AND coupon.status = 1\n
                                  GROUP BY shop_id\n
                              ) as mc\n
                              ON mc.id = c.id\n
                              AND c.active = 1\n
                              AND c.status = 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.created as news_datetime\n
                          FROM news as n\n
                          INNER JOIN (\n
                              SELECT shop_id, id \n
                              FROM news\n
                                  INNER JOIN v_business_date as v\n
                              WHERE start_date <= v.business_date \n
                              AND (end_date > v.business_date OR end_date IS NULL) \n
                              AND active = 1\n
                              GROUP BY shop_id\n
                              HAVING MAX(news.created)\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 WHERE active = 1 AND visible = 0 AND rank <= 3 GROUP BY shop_id, sm.url, rank ) 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
                      INNER JOIN (\n
                              SELECT\n
                                  shop_id as shop_id,\n
                                  SUM(point) as point\n
                              FROM (\n
                                  SELECT\n
                                      distinct  \n
                                      date_format(pv.date, '%Y-%m-%d') as date,\n
                                      pv.pref_id, \n
                                      s.pref_area_id, \n
                                      pv.shop_id, \n
                                      pv.addr,\n
                                      pv.type,\n
                                      CASE \n
                                          WHEN pv.type = 1 THEN 1\n
                                          WHEN pv.type = 2 THEN 1\n
                                          WHEN pv.type = 3 THEN 1\n
                                      END point\n
                                  FROM pv_shop_new as pv\n
                                  INNER JOIN shop s \n
                                      ON s.id = pv.shop_id\n
                                      AND s.active = 1\n
                                  INNER JOIN shop_default_play sd\n
                                      ON s.id = sd.shop_id\n
                                      AND sd.system_option_id = ?\n
                                  WHERE pv.pref_id = ?\n
                                  AND pv.date >= ?\n
                                  AND pv.date <= ?\n
                                  GROUP BY \n
                                      date_format(pv.date, '%Y-%m-%d'),\n
                                      pv.pref_id, \n
                                      s.pref_area_id, \n
                                      pv.shop_id, \n
                                      pv.addr,\n
                                      pv.type\n
          \n
                                  UNION ALL\n
          \n
                                  SELECT\n
                                      distinct  \n
                                      date_format(op.date, '%Y-%m-%d') as date,\n
                                      op.pref_id, \n
                                      s.pref_area_id, \n
                                      op.shop_id, \n
                                      'admin',\n
                                      op.type,\n
                                      CASE \n
                                          WHEN op.type = 1 THEN 5\n
                                          WHEN op.type = 2 THEN 10\n
                                          WHEN op.type = 3 THEN 5\n
                                      END point\n
                                  FROM op_shop as op\n
                                  INNER JOIN shop s \n
                                      ON s.id = op.shop_id\n
                                      AND s.active = 1\n
                                  INNER JOIN shop_default_play sd\n
                                      ON s.id = sd.shop_id\n
                                      AND sd.system_option_id = ?\n
                                  WHERE op.pref_id = ?\n
                                  AND op.date >= ?\n
                                  AND op.date <= ?\n
                                  GROUP BY \n
                                      date_format(op.date, '%Y-%m-%d'),\n
                                      op.pref_id, \n
                                      s.pref_area_id, \n
                                      op.shop_id, \n
                                      op.type\n
                              ) as point\n
                              GROUP BY\n
                                  shop_id\n
                          ) rnk\n
                          ON s.id = rnk.shop_id\n
                  WHERE s.active = ?\n
                  AND s.pref_id = ?\n
                  AND s.start_datetime <= ?\n
                  AND (s.end_datetime >= ? or s.end_datetime is null) \n
                  ORDER BY rnk.point DESC\n
                  LIMIT 100\n
                ' with params ["2026-08-31 17:35:53", "2026-08-31 17:35:53", "12", 39, "2026-08-24 00:00:00", "2026-08-31 23:59:59", "12", 39, "2026-08-24 00:00:00", "2026-08-31 23:59:59", 1, 39, "2026-08-31 17:35:53", "2026-08-31 17:35:53"]:\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 143
          """
      }
    }
    /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 {#1077}
        $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
                      rnk.point as point,\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.active = 1\n
                                  AND coupon.status = 1\n
                                  GROUP BY shop_id\n
                              ) as mc\n
                              ON mc.id = c.id\n
                              AND c.active = 1\n
                              AND c.status = 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.created as news_datetime\n
                          FROM news as n\n
                          INNER JOIN (\n
                              SELECT shop_id, id \n
                              FROM news\n
                                  INNER JOIN v_business_date as v\n
                              WHERE start_date <= v.business_date \n
                              AND (end_date > v.business_date OR end_date IS NULL) \n
                              AND active = 1\n
                              GROUP BY shop_id\n
                              HAVING MAX(news.created)\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 WHERE active = 1 AND visible = 0 AND rank <= 3 GROUP BY shop_id, sm.url, rank ) 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
                      INNER JOIN (\n
                              SELECT\n
                                  shop_id as shop_id,\n
                                  SUM(point) as point\n
                              FROM (\n
                                  SELECT\n
                                      distinct  \n
                                      date_format(pv.date, '%Y-%m-%d') as date,\n
                                      pv.pref_id, \n
                                      s.pref_area_id, \n
                                      pv.shop_id, \n
                                      pv.addr,\n
                                      pv.type,\n
                                      CASE \n
                                          WHEN pv.type = 1 THEN 1\n
                                          WHEN pv.type = 2 THEN 1\n
                                          WHEN pv.type = 3 THEN 1\n
                                      END point\n
                                  FROM pv_shop_new as pv\n
                                  INNER JOIN shop s \n
                                      ON s.id = pv.shop_id\n
                                      AND s.active = 1\n
                                  INNER JOIN shop_default_play sd\n
                                      ON s.id = sd.shop_id\n
                                      AND sd.system_option_id = ?\n
                                  WHERE pv.pref_id = ?\n
                                  AND pv.date >= ?\n
                                  AND pv.date <= ?\n
                                  GROUP BY \n
                                      date_format(pv.date, '%Y-%m-%d'),\n
                                      pv.pref_id, \n
                                      s.pref_area_id, \n
                                      pv.shop_id, \n
                                      pv.addr,\n
                                      pv.type\n
          \n
                                  UNION ALL\n
          \n
                                  SELECT\n
                                      distinct  \n
                                      date_format(op.date, '%Y-%m-%d') as date,\n
                                      op.pref_id, \n
                                      s.pref_area_id, \n
                                      op.shop_id, \n
                                      'admin',\n
                                      op.type,\n
                                      CASE \n
                                          WHEN op.type = 1 THEN 5\n
                                          WHEN op.type = 2 THEN 10\n
                                          WHEN op.type = 3 THEN 5\n
                                      END point\n
                                  FROM op_shop as op\n
                                  INNER JOIN shop s \n
                                      ON s.id = op.shop_id\n
                                      AND s.active = 1\n
                                  INNER JOIN shop_default_play sd\n
                                      ON s.id = sd.shop_id\n
                                      AND sd.system_option_id = ?\n
                                  WHERE op.pref_id = ?\n
                                  AND op.date >= ?\n
                                  AND op.date <= ?\n
                                  GROUP BY \n
                                      date_format(op.date, '%Y-%m-%d'),\n
                                      op.pref_id, \n
                                      s.pref_area_id, \n
                                      op.shop_id, \n
                                      op.type\n
                              ) as point\n
                              GROUP BY\n
                                  shop_id\n
                          ) rnk\n
                          ON s.id = rnk.shop_id\n
                  WHERE s.active = ?\n
                  AND s.pref_id = ?\n
                  AND s.start_datetime <= ?\n
                  AND (s.end_datetime >= ? or s.end_datetime is null) \n
                  ORDER BY rnk.point DESC\n
                  LIMIT 100\n
                
          """
        $params: array:14 [ …14]
      }
    }
    /home/www/front/src/Repository/PvRepository.php:1731 {$stmt = $em->prepare($sql);$stmt->execute($params);arguments: {
        $params: array:14 [ …14]
      }
    }
    /home/www/front/src/Controller/Pref/PrefController.php:2130 {// 総合$Shops = $this->pvRepository->getShopRanking($this->Pref, $from, $to, $area_id, $service_id, false, false, 100);arguments: {
        $pref: Pref {#959 …}
        $from: "2026-08-24"
        $to: "2026-08-31"
        $pref_area: null
        $service: "12"
        $is_new: false
        $new_period: false
        $limit: 100
      }
    }
    /home/www/front/vendor/symfony/http-kernel/HttpKernel.php:149 {// call controller$response = \call_user_func_array($controller, $arguments);arguments: {
        $request: Request {#4 …}
        $route: "kochi"
        $area_id: null
        $service_id: "12"
      }
    }
    /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 …}
      }
    }
  }
}