evanmsanders / flex2sms

Web front-end to SACFS flex2sms system.
1 stars 0 forks source link

Keyword select query #62

Closed mazzone closed 11 years ago

mazzone commented 11 years ago

The following query works for returning keywords (as a semicolon separated list), but only works if the service has keywords associated.

SELECT contacts.number, contacts.email, services.type, services.id, contacts.id, group_concat(keywords.word SEPARATOR ';') keywords 
FROM contacts, capcodes, services, contacts_services, keywords, keywords_services
WHERE capcodes.code = '1908870' 
AND services.capcode_id = capcodes.id 
AND services.active = 1 
AND contacts_services.service_id = services.id 
AND contacts.id = contacts_services.contact_id
AND keywords_services.service_id = services.id
AND keywords.id = keywords_services.keyword_id;

Can we fix it so it returns phone numbers regardless of whether keywords are set or not? or should we set up a keyword that is assigned to all services as a hackish fix?

evanmsanders commented 11 years ago

Is this fixed now, after your conversation with LR?