- Thai Trade Hub -
- ศูนย์กลางการค้าไทย -
SELECT SQL_CALC_FOUND_ROWS customers.id, customers.member_type, customers.sub_type, customers.company_logo, customers.company_name
, customers.slug, customers.first_name, customers.last_name, customers.phone, customers.mobile, customers.email
, customers.designation, customers.ntn, customers.website, customers.dob, customers.photo
, customers.city, customers.state, customers.country, customers.status, customers.package_id, customers.package_status
, customers.short_name, customers.falcon_profile_url, customers.profile_photo
, is_completed, profile_access
, (
(customers.company_name = 'Mikiko, A-line short skirt, chiffon fabric') * 100
+ (customers.company_name LIKE 'Mikiko, A-line short skirt, chiffon fabric%') * 50
+ (customers.company_name LIKE '%Mikiko, A-line short skirt, chiffon fabric%') * 20
+ (search.keyword LIKE '%Mikiko, A-line short skirt, chiffon fabric%') * 5
+ (search.keyword LIKE '%Mikiko,%') * 2
+ (search.keyword LIKE '%A-line%') * 2
+ (search.keyword LIKE '%short%') * 2
+ (search.keyword LIKE '%skirt,%') * 2
+ (search.keyword LIKE '%chiffon%') * 2
+ (search.keyword LIKE '%fabric%') * 2
) AS relevance
FROM customers
LEFT JOIN customer_own_products ON (customer_own_products.created_by=customers.id)
LEFT JOIN customer_products ON (customers.id = customer_products.customer_id)
LEFT JOIN products ON (products.id = customer_products.product_id)
LEFT JOIN search ON (customers.id = search.member_id)
WHERE 1 AND customers.status='Active'
AND customers.member_type IN('Basic', 'Standard', 'Premium', 'Premium Plus')
AND customers.parent_id = 0
AND ((products.title LIKE '%Mikiko,%' OR products.keywords LIKE '%Mikiko,%' OR customer_own_products.title LIKE '%Mikiko,%' OR customer_own_products.keywords LIKE '%Mikiko,%') AND (products.title LIKE '%A-line%' OR products.keywords LIKE '%A-line%' OR customer_own_products.title LIKE '%A-line%' OR customer_own_products.keywords LIKE '%A-line%') AND (products.title LIKE '%short%' OR products.keywords LIKE '%short%' OR customer_own_products.title LIKE '%short%' OR customer_own_products.keywords LIKE '%short%') AND (products.title LIKE '%skirt,%' OR products.keywords LIKE '%skirt,%' OR customer_own_products.title LIKE '%skirt,%' OR customer_own_products.keywords LIKE '%skirt,%') AND (products.title LIKE '%chiffon%' OR products.keywords LIKE '%chiffon%' OR customer_own_products.title LIKE '%chiffon%' OR customer_own_products.keywords LIKE '%chiffon%') AND (products.title LIKE '%fabric%' OR products.keywords LIKE '%fabric%' OR customer_own_products.title LIKE '%fabric%' OR customer_own_products.keywords LIKE '%fabric%'))
GROUP BY customers.id
ORDER BY FIELD(customers.member_type,'Premium Plus','Premium','Standard','Basic'), relevance DESC, customers.ordering ASC
LIMIT 0,20
Companies matching “Mikiko, A-line short skirt, chiffon fabric”