ERROR:  column b.name does not exist
LINE 3:    b.id as brand_id, b.name as brand_name,
                             ^
HINT:  Perhaps you meant to reference the column "s.name".


query(): SELECT p.id, p.category_id, p.price, p.tax_class_id, p.quantity, p.file_id, pd.name, pd.description, pd.application, pd.meta_title, pd.meta_description, pd.meta_keywords, b.id as brand_id, b.name as brand_name, ARRAY(SELECT file_id FROM s_product_image WHERE site_id = '19' AND product_id = p.id ORDER BY sort_order) as images, (SELECT ARRAY[f.id::text, (CASE WHEN strpos(f.mime_type, 'image') != 0 THEN f.path || '/' || f.savename END), f.name] FROM s_product_image pi LEFT JOIN s_file f ON f.site_id = '19' AND f.id = pi.file_id AND f.is_trash IS NULL WHERE pi.site_id = '19' AND pi.product_id = p.id ORDER BY pi.sort_order, pi.file_id LIMIT 1 OFFSET (p.default_image - 1) ) as file, s.name as supplier_name, s.contact_person, s.email, s.telephone FROM s_product p LEFT JOIN s_product_description pd ON pd.site_id = '19' AND pd.product_id = p.id AND pd.language_id = '1' LEFT JOIN s_brand b ON b.site_id = '19' AND p.brand_id = b.id LEFT JOIN s_supplier s ON s.site_id = '19' AND p.supplier_id = s.id WHERE p.id = '1113' AND p.site_id = '19' AND p.status = 1

BACKTRACE:

File: /home/res/libs/class.pgDB.php [LINE 344]
Call: pgDB->backtrace()

File: /home/res/libs/class.pgDB.php [LINE 56]
Call: pgDB->error(Resource(#1)(pgsql link), Object(Exception))

File: /home/www/tcxrhb.com/zh-CN/product.php [LINE 31]
Call: pgDB->query("SELECT p.id, p.category_id, p.price, p.tax_class_id, p.quantity,...")