visuddhinanda %!s(int64=2) %!d(string=hai) anos
pai
achega
9709514820
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      app/Http/Controllers/VocabularyController.php

+ 2 - 2
app/Http/Controllers/VocabularyController.php

@@ -25,11 +25,11 @@ class VocabularyController extends Controller
                 $result = RedisClusters::remember("/dict_vocabulary/{$key}",
                         config('mint.cache.expire'),
                         function() use($key){
-                        return Vocabulary::whereRaw('word like ? or word_en like ?',[$key."%",$key."%"])
+                            return Vocabulary::where('word', 'like',$key."%")
                                     ->whereOr('word_en','like',$key."%")
                                     ->orderBy('strlen')
                                     ->orderBy('word')
-                                    ->take(10)->get();
+                                    ->take(50)->get();
                 });
                 return $this->ok(['rows'=>VocabularyResource::collection($result),'count'=>count($result)]);
                 break;