I have three models.
- ScheduledMessage points to table scheduled_messages.
- SubscribedService points to table subscribed_services.
- SubscriptionServicesMsisdn points to table subscription_services_msisdn.
I have raw sql query that I would want to convert into eloquent but can not think of a way.
SQL Query:
SELECT DISTINCT
b.message, c. phone_number, a.username, a.password from subscribed_services a
inner join
subscription_services_msisdn c on a.id = c.subscribed_services_id
inner join
scheduled_messages b on a.id = b.subscribed_services_id where DATE(b.scheduled_at) = CURDATE()
Would someone please help convert to eloquent. Thank you.
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2sm1Kqw
via IFTTT
Aucun commentaire:
Enregistrer un commentaire