فهرست منبع

Merge pull request #1742 from visuddhinanda/laravel

添加错误输出
visuddhinanda 2 سال پیش
والد
کامیت
fee89c7b10
1فایلهای تغییر یافته به همراه12 افزوده شده و 2 حذف شده
  1. 12 2
      app/Console/Commands/TestSearchPali.php

+ 12 - 2
app/Console/Commands/TestSearchPali.php

@@ -40,9 +40,19 @@ class TestSearchPali extends Command
     {
         $word = 'citta';
         $result = PaliSearch::search([$word],[],'case',0,3);
-        $this->info("word={$word} total=".$result['total']);
+        if($result){
+            $this->info("word={$word} total=".$result['total']);
+        }else{
+            $this->error('word={$word} search fail');
+        }
+
         $result = PaliSearch::search([$word],[267],'case',0,3);
-        $this->info("word={$word} book=267 total=".$result['total']);
+        if($result){
+            $this->info("word={$word} book=267 total=".$result['total']);
+        }else{
+            $this->error('word={$word} book=267 search fail');
+        }
+
         return 0;
     }
 }