File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ public function distinct($column = false)
268268 */
269269 public function orderBy ($ column , $ direction = 'asc ' )
270270 {
271- $ this ->orders [$ column ] = ($ direction == 'asc ' ? 1 : -1 );
271+ $ this ->orders [$ column ] = (strtolower ( $ direction) == 'asc ' ? 1 : -1 );
272272
273273 return $ this ;
274274 }
Original file line number Diff line number Diff line change @@ -142,6 +142,9 @@ public function testOrder()
142142 $ user = User::whereNotNull ('age ' )->orderBy ('age ' , 'asc ' )->first ();
143143 $ this ->assertEquals (13 , $ user ->age );
144144
145+ $ user = User::whereNotNull ('age ' )->orderBy ('age ' , 'ASC ' )->first ();
146+ $ this ->assertEquals (13 , $ user ->age );
147+
145148 $ user = User::whereNotNull ('age ' )->orderBy ('age ' , 'desc ' )->first ();
146149 $ this ->assertEquals (37 , $ user ->age );
147150 }
You can’t perform that action at this time.
0 commit comments