修复策略组设置无效的bug

This commit is contained in:
wispx
2019-03-06 10:56:45 +08:00
parent 523d3975d8
commit 2f3c50d746
+13 -7
View File
@@ -67,9 +67,10 @@ class Upload extends Base
}
// 当前储存策略
$currentStrategy = strtolower($this->config['storage_strategy']);
$currentStrategy = strtolower($this->group->strategy);
// 获取当前储存策略配置
$strategyConfig = $this->currentStrategyConfig;
// 获取当前驱动实例
$strategy = $this->getStrategyInstance();
@@ -147,10 +148,15 @@ class Upload extends Base
$data = [
'name' => $image->getInfo('name'),
'url' => $url,
'size' => $size,
'mime' => $mime,
'sha1' => $sha1,
'md5' => $md5,
];
if ($this->user) {
$data['quota'] = sprintf('%.2f', (float) $user->quota);
$data['use_quota'] = sprintf('%.2f', (float) $user->use_quota);
$data['quota'] = sprintf('%.2f', (float)$user->quota);
$data['use_quota'] = sprintf('%.2f', (float)$user->use_quota);
}
return $data;
@@ -199,10 +205,10 @@ class Upload extends Base
), '/');
$file = trim(str_replace(
array_column($naming['file'], 'name'),
array_column($naming['file'], 'value'),
$this->config['file_naming_rule']
), '/') . '.' . get_file_ext($name);
array_column($naming['file'], 'name'),
array_column($naming['file'], 'value'),
$this->config['file_naming_rule']
), '/') . '.' . get_file_ext($name);
return $path . '/' . $file;
}