I have 3 tables,
subscribers-
subscribers_lists_subscribers-
And subscribers_lists
I am trying to have a query like this-
$baseQuery = DB::table( 'subscribers_lists')
->leftjoin('subscribers_lists_subscribers', 'subscribers_lists.id', '=', 'subscribers_lists_subscribers.subscribers_list_id')
->leftjoin('subscribers', 'subscribers_lists_subscribers.subscriber_id', '=', 'subscribers.id')
->select(
'subscribers_lists.id as count_clickers',
DB::raw('count(subscribers_lists_subscribers.subscribers_list_id where subscribers.status = "Active") as count_active')
'subscribers_lists.updated_at as last_activity'
)
->groupBy('subscribers_lists.id');
I nee to have this-
where subscribers.status = "Active"
And gtting error, can anyonne please help, what I am doing wrong?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire