|
|
@@ -110,7 +110,17 @@ class ConfigService
|
|
|
// 返回本地配置文件中的值
|
|
|
return config('project.' . $type . '.' . $name);
|
|
|
}
|
|
|
- // 返回默认值或本地配置文件中的值
|
|
|
- return $default_value !== null ? $default_value : config('project.' . $type . '.' . $name);
|
|
|
+
|
|
|
+ // 取某个类型下的所有name的值
|
|
|
+ $data = Config::where(['type' => $type])->column('value', 'name');
|
|
|
+ foreach ($data as $k => $v) {
|
|
|
+ $json = json_decode($v, true);
|
|
|
+ if (json_last_error() === JSON_ERROR_NONE) {
|
|
|
+ $data[$k] = $json;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($data) {
|
|
|
+ return $data;
|
|
|
+ }
|
|
|
}
|
|
|
}
|