wngur6076 1 月之前
父節點
當前提交
f716fa9dea
共有 1 個文件被更改,包括 18 次插入0 次删除
  1. 18 0
      app/Helpers/DataConverter.php

+ 18 - 0
app/Helpers/DataConverter.php

@@ -189,6 +189,11 @@ class DataConverter
         return self::$codeTitle['ship-type'][$value][$data]['Title'] ?? 'Invalid';
     }
 
+    public static function format_func_body_situation($value, $data)
+    {
+        return self::$codeTitle['body-situation'][$value][$data]['Title'] ?? 'Invalid';
+    }
+
     public static function get_status($value)
     {
         if (isset(self::$codeTitle['status'][$value])) {
@@ -396,4 +401,17 @@ class DataConverter
             self::$codeTitle['condition-type'][$value] = null;
         }
     }
+
+    public static function get_body_situation($value)
+    {
+        if (isset(self::$codeTitle['body-situation'][$value])) {
+            return;
+        }
+
+        try {
+            self::$codeTitle['body-situation'][$value] = collect(Utils::getParamFile("/etc/code-title/body-situation/{$value}"))->keyBy('Code')->toArray();
+        } catch (ParameterException $e) {
+            self::$codeTitle['body-situation'][$value] = null;
+        }
+    }
 }