SQL Error: ERROR: more than one row returned by a subquery used as an expression at /home/web/storona/web/storona/dynamic/simfosoft/lib/SiteFunctions/SiteFunctions.php line 1533
Array
(
    [code] => 
    [message] => ERROR:  more than one row returned by a subquery used as an expression
    [query] => SELECT cts.id_sort AS id, gv.lkcatalogid AS catalogid, gv.crttime AS create, sn.name AS name
         FROM class_to_sort cts
         JOIN goodsview gv ON gv.lksortid=cts.id_sort
         JOIN sort s ON s.id=cts.id_sort
         JOIN sortname sn ON sn.lksortid=s.id
         WHERE cts.id_class=(SELECT id_class FROM class_to_sort WHERE id_sort=$1)
          AND cts.id_sort IN (SELECT lksortid FROM goodsview WHERE lkcatalogid IN(106,108,109,111)) 
          AND (s.showsort AND NOT s.locksort) AND s.crttime<'16.12.2018' 
             ORDER BY gv.crttime DESC
    [context] => /home/web/storona/web/storona/dynamic/simfosoft/lib/SiteFunctions/SiteFunctions.php line 1533
)