Selecting up_votes - down_votes as total_votes and ordering them with laravel -
hi there have trouble getting sum of following query , orderby highest sum.
counters::orderby('up_votes - down_votes total_votes', 'desc')->take(10)->get()
counters::select(db::raw('*, up_votes - down_votes total_votes'))
Comments
Post a Comment