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

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -