@@ -30,13 +30,13 @@ func (dc DalCard) Fetch(uuid []byte) (*models.Card, error) {
3030
3131func (dc DalCard ) FetchAll () (* []models.Card , error ) {
3232 results := []models.Card {}
33- err := dc .collection .Find (nil ).Sort ("name" ).All (& results )
33+ err := dc .collection .Find (nil ).Sort ("name.en-US " ).All (& results )
3434 return & results , err
3535}
3636
3737func (dc DalCard ) FetchAllPaging (limit int , offset int ) (* []models.Card , int , error ) {
3838 results := []models.Card {}
39- query := dc .collection .Find (nil ).Limit (limit ).Sort ("name" ).Skip (offset )
39+ query := dc .collection .Find (nil ).Limit (limit ).Sort ("name.en-US " ).Skip (offset )
4040 err := query .All (& results )
4141 count , _ := dc .collection .Find (nil ).Count ()
4242 // db driver is bugged
@@ -59,13 +59,13 @@ func (dc DalCard) FetchQueryPaging(limit int, offset int, cardQuery CardQuery) (
5959
6060func (dc DalCard ) FetchLeaderPaging (groupID bson.ObjectId , limit int , offset int ) (* []models.Card , error ) {
6161 results := []models.Card {}
62- err := dc .collection .Find (bson.M {"group_id" : groupID }).Limit (limit ).Sort ("name" ).Skip (offset ).All (& results )
62+ err := dc .collection .Find (bson.M {"group_id" : groupID }).Limit (limit ).Sort ("name.en-US " ).Skip (offset ).All (& results )
6363 return & results , err
6464}
6565
6666func (dc DalCard ) FetchFromFactionPaging (factionID bson.ObjectId , limit int , offset int ) (* []models.Card , error ) {
6767 results := []models.Card {}
68- err := dc .collection .Find (bson.M {"faction_id" : factionID }).Limit (limit ).Sort ("name" ).Skip (offset ).All (& results )
68+ err := dc .collection .Find (bson.M {"faction_id" : factionID }).Limit (limit ).Sort ("name.en-US " ).Skip (offset ).All (& results )
6969 return & results , err
7070}
7171
@@ -81,7 +81,7 @@ func (dc DalCard) CountFromFaction(factionID bson.ObjectId) (int, error) {
8181
8282func (dc DalCard ) FetchFromArray (cardIDs []bson.ObjectId ) (* []models.Card , error ) {
8383 results := []models.Card {}
84- err := dc .collection .Find (bson.M {"_id" : bson.M {"$in" : cardIDs }}).Sort ("name" ).All (& results )
84+ err := dc .collection .Find (bson.M {"_id" : bson.M {"$in" : cardIDs }}).Sort ("name.en-US " ).All (& results )
8585
8686 return & results , err
8787}
0 commit comments