jeudi 1 décembre 2016

Laravel 5.2 Query not working

Hi i am trying to get this query to work...

DB::select(DB::raw('select 
sum(case when outreach_links.status="Pending" and outreach_links.created_at >= :from and outreach_links.created_at <=:to then 1 else 0 end) as pp,
  sum(case when outreach_links.status="Approved" and outreach_links.start_date >= :from and outreach_links.start_date <=:to then 1 else 0 end) as aa, sum(case when outreach_links.status="Approved" then outreach_links.cost else 0 end) as cc, MONTH(outreach_links.created_at) month, MONTHNAME(outreach_links.created_at) month_name , YEAR(outreach_links.created_at) year from outreach inner join outreach_links on outreach.id = outreach_links.outreach_id where outreach.profile_id=:proid group by month, year', ["from" => $from, "to" => $to, "proid" => $pro_id]))->get();

and I am getting an error, I cant solve it any help??

Call to a member function get() on a non-object

any idea how to make this query work using get()?

Thanks



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2fWVim0
via IFTTT

Aucun commentaire:

Enregistrer un commentaire