File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 11language : php
22
33php :
4- - 5.5
54 - 5.6
65 - 7.0
76
Original file line number Diff line number Diff line change @@ -336,7 +336,7 @@ public function getAvatar()
336336 return $ this ->author ->getAvatar ();
337337 }
338338
339- return 'http://www.gravatar.com/avatar/00000000000000000000000000000000 ?d=mm&f=y&s=50 ' ;
339+ return 'http://www.gravatar.com/avatar?d=mm&f=y&s=50 ' ;
340340 }
341341
342342 /**
@@ -346,7 +346,16 @@ public function getAvatar()
346346 */
347347 public static function getAuthors ()
348348 {
349- return ArrayHelper::map (static ::find ()->joinWith ('author ' )->groupBy ('createdBy ' )->asArray ()->all (), 'createdBy ' , 'author.username ' );
349+ $ query = static ::find ()
350+ ->alias ('c ' )
351+ ->select (['c.createdBy ' , 'a.username ' ])
352+ ->joinWith ('author a ' )
353+ ->groupBy (['c.createdBy ' , 'a.username ' ])
354+ ->orderBy ('a.username ' )
355+ ->asArray ()
356+ ->all ();
357+
358+ return ArrayHelper::map ($ query , 'createdBy ' , 'author.username ' );
350359 }
351360
352361 /**
You can’t perform that action at this time.
0 commit comments