Error#: 42601: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ")"
LINE 16: AND isCompanyProfileComplete(c.companyid)) as t
^, query was: SELECT COUNT(distinct c.companyid) AS total_row_count FROM company_verified c
JOIN link_location_verified pll ON (pll.ref_id = c.companyid AND pll.ref_type = 'company' AND pll.is_primary AND NOT pll.deleted_flag)
JOIN location_verified pl ON (pl.locationid = pll.locationid AND NOT pl.deleted_flag)
JOIN link_location_verified ll ON (ll.ref_id = c.companyid AND ll.ref_type = 'company' AND NOT ll.deleted_flag)
JOIN location_verified l ON (l.locationid = ll.locationid AND NOT l.deleted_flag)
JOIN company_purchase cs ON (cs.product_type_code = 'subscription' AND cs.companyid = c.companyid AND cs.current)
JOIN company_purchase_level cpl ON (cpl.product_type_code = cs.product_type_code AND (cpl.bit_code::BIGINT & cs.features_bit_code::BIGINT) = cpl.bit_code::BIGINT AND cpl.title = 'Premium') LEFT OUTER JOIN link_image lsi ON (lsi.ref_type = 'company' AND lsi.ref_id = cs.companyid AND lsi.channelid = 2 AND lsi.image_type = 'logo' AND lsi.is_verified)
LEFT OUTER JOIN subscription_data s ON (s.companyid = cs.companyid AND s.is_verified)
WHERE (l.address_street_1 IS NOT NULL OR l.address_street_2 IS NOT NULL)
AND l.address_street_city IS NOT NULL
AND (l.ph_number IS NOT NULL OR l.email IS NOT NULL OR l.url IS NOT NULL)
AND c.active_status
AND c.is_verified
AND NOT c.deleted_flag
AND NOT c.non_trading
AND isCompanyProfileComplete(c.companyid)) as t
File = /var/app/current/private/library/Zend/Db/Statement/Pdo.php
Line = 235
Statement.php: 323 _execute ()
Abstract.php: 480 execute ()
Abstract.php: 238 query (SELECT COUNT(distinct c.companyid) AS total_row_count FROM company_verified c
JOIN link_location_verified pll ON (pll.ref_id = c.companyid AND pll.ref_type = 'company' AND pll.is_primary AND NOT pll.deleted_flag)
JOIN location_verified pl ON (pl.locationid = pll.locationid AND NOT pl.deleted_flag)
JOIN link_location_verified ll ON (ll.ref_id = c.companyid AND ll.ref_type = 'company' AND NOT ll.deleted_flag)
JOIN location_verified l ON (l.locationid = ll.locationid AND NOT l.deleted_flag)
JOIN company_purchase cs ON (cs.product_type_code = 'subscription' AND cs.companyid = c.companyid AND cs.current)
JOIN company_purchase_level cpl ON (cpl.product_type_code = cs.product_type_code AND (cpl.bit_code::BIGINT & cs.features_bit_code::BIGINT) = cpl.bit_code::BIGINT AND cpl.title = 'Premium') LEFT OUTER JOIN link_image lsi ON (lsi.ref_type = 'company' AND lsi.ref_id = cs.companyid AND lsi.channelid = 2 AND lsi.image_type = 'logo' AND lsi.is_verified)
LEFT OUTER JOIN subscription_data s ON (s.companyid = cs.companyid AND s.is_verified)
WHERE (l.address_street_1 IS NOT NULL OR l.address_street_2 IS NOT NULL)
AND l.address_street_city IS NOT NULL
AND (l.ph_number IS NOT NULL OR l.email IS NOT NULL OR l.url IS NOT NULL)
AND c.active_status
AND c.is_verified
AND NOT c.deleted_flag
AND NOT c.non_trading
AND isCompanyProfileComplete(c.companyid)) as t )
Db.php: 10 query (SELECT COUNT(distinct c.companyid) AS total_row_count FROM company_verified c
JOIN link_location_verified pll ON (pll.ref_id = c.companyid AND pll.ref_type = 'company' AND pll.is_primary AND NOT pll.deleted_flag)
JOIN location_verified pl ON (pl.locationid = pll.locationid AND NOT pl.deleted_flag)
JOIN link_location_verified ll ON (ll.ref_id = c.companyid AND ll.ref_type = 'company' AND NOT ll.deleted_flag)
JOIN location_verified l ON (l.locationid = ll.locationid AND NOT l.deleted_flag)
JOIN company_purchase cs ON (cs.product_type_code = 'subscription' AND cs.companyid = c.companyid AND cs.current)
JOIN company_purchase_level cpl ON (cpl.product_type_code = cs.product_type_code AND (cpl.bit_code::BIGINT & cs.features_bit_code::BIGINT) = cpl.bit_code::BIGINT AND cpl.title = 'Premium') LEFT OUTER JOIN link_image lsi ON (lsi.ref_type = 'company' AND lsi.ref_id = cs.companyid AND lsi.channelid = 2 AND lsi.image_type = 'logo' AND lsi.is_verified)
LEFT OUTER JOIN subscription_data s ON (s.companyid = cs.companyid AND s.is_verified)
WHERE (l.address_street_1 IS NOT NULL OR l.address_street_2 IS NOT NULL)
AND l.address_street_city IS NOT NULL
AND (l.ph_number IS NOT NULL OR l.email IS NOT NULL OR l.url IS NOT NULL)
AND c.active_status
AND c.is_verified
AND NOT c.deleted_flag
AND NOT c.non_trading
AND isCompanyProfileComplete(c.companyid)) as t )
Company.php: 4893 __call (query)
SupplierController.php: 133 getPremiumSubscribers ( limit 50 OFFSET 0)
Action.php: 516 premiumAction ()
Standard.php: 308 dispatch (premiumAction)
Front.php: 954 dispatch ()
Bootstrap.php: 139 dispatch ()
index.php: 4 run ()
index.php: 3 require (/var/app/current/private/application/index.php)