浏览代码

:bug: case 不包含# 500

visuddhinanda 3 年之前
父节点
当前提交
d0ac15c675
共有 1 个文件被更改,包括 13 次插入 和 3 次删除
  1. 13 3
      app/Http/Controllers/ExportWbwController.php

+ 13 - 3
app/Http/Controllers/ExportWbwController.php

@@ -55,9 +55,19 @@ class ExportWbwController extends Controller
                 foreach ($wordsList as $word) {
                     $pali = $word->real->__toString();
                     $case = explode("#",$word->case->__toString()) ;
-                    $type = $case[0];
-                    $grammar = $case[1];
-                    $grammar = str_replace("null","",$grammar);
+                    if(isset($case[0])){
+                        $type = $case[0];
+                    }else{
+                        $type = "";
+                    }
+
+                    if(isset($case[1])){
+                        $grammar = $case[1];
+                        $grammar = str_replace("null","",$grammar);
+                    }else{
+                        $grammar = "";
+                    }
+
                     $style = $word->style->__toString();
                     $factormeaning = str_replace("
","",$word->om->__toString());
                     $factormeaning = str_replace("↓↓","",$factormeaning);