This commit is contained in:
2020-02-18 10:15:02 +08:00
parent 5fb45fc57c
commit d4325e3016
18 changed files with 194 additions and 159 deletions

View File

@@ -63,4 +63,19 @@ function get_client_ip($type = 0, $adv = false) {
function avatar($uid, $size = 'middle') {
return request()->root(true) . '/static/common/images/default_avatar_' . $size . '.jpg';
}
// 分析枚举类型配置值 格式 a:名称1,b:名称2
function parse_config_attr($string) {
$array = preg_split('/[,;\r\n]+/', trim($string, ",;\r\n"));
if (strpos($string, ':')) {
$value = array();
foreach ($array as $val) {
list($k, $v) = explode(':', $val);
$value[$k] = $v;
}
} else {
$value = $array;
}
return $value;
}