|
@@ -46,7 +46,7 @@ class SystemStorageServices extends BaseServices
|
|
|
[$page, $limit] = $this->getPageValue();
|
|
|
$config = $this->getStorageConfig((int)$where['type']);
|
|
|
$where['access_key'] = $config['accessKey'];
|
|
|
- $list = $this->getList($where,'*', $page, $limit);
|
|
|
+ $list = $this->getList($where, '*', $page, $limit);
|
|
|
foreach ($list as &$item) {
|
|
|
$item['_add_time'] = date('Y-m-d H:i:s', $item['add_time']);
|
|
|
$item['_update_time'] = date('Y-m-d H:i:s', $item['update_time']);
|
|
@@ -194,7 +194,7 @@ class SystemStorageServices extends BaseServices
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- if ($this->dao->count(['type' => $type, 'name' => $name])) {
|
|
|
+ if ($this->getCount(['type' => $type, 'name' => $name])) {
|
|
|
throw new ValidateException('云空间名称不能重复');
|
|
|
}
|
|
|
//保存云存储
|
|
@@ -239,7 +239,7 @@ class SystemStorageServices extends BaseServices
|
|
|
throw new ValidateException('同步失败,失败原因:' . $upload->getError());
|
|
|
}
|
|
|
foreach ($list as $item) {
|
|
|
- if (!$this->dao->count(['name' => $item['id'], 'is_delete' => 0, 'access_key' => $config['accessKey']])) {
|
|
|
+ if (!$this->getCount(['name' => $item['id'], 'is_delete' => 0, 'access_key' => $config['accessKey']])) {
|
|
|
$data[] = [
|
|
|
'type' => $type,
|
|
|
'access_key' => $config['accessKey'],
|
|
@@ -259,7 +259,7 @@ class SystemStorageServices extends BaseServices
|
|
|
$list = $upload->listbuckets();
|
|
|
$config = $this->getStorageConfig($type);
|
|
|
foreach ($list as $item) {
|
|
|
- if (!$this->dao->count(['name' => $item['name'], 'is_delete' => 0, 'access_key' => $config['accessKey']])) {
|
|
|
+ if (!$this->getCount(['name' => $item['name'], 'is_delete' => 0, 'access_key' => $config['accessKey']])) {
|
|
|
$region = $this->getReagionHost($type, $item['location']);
|
|
|
$data[] = [
|
|
|
'type' => $type,
|
|
@@ -281,8 +281,8 @@ class SystemStorageServices extends BaseServices
|
|
|
$list = $upload->listbuckets();
|
|
|
$config = $this->getStorageConfig($type);
|
|
|
foreach ($list as $item) {
|
|
|
- if (($id = $this->dao->value(['name' => $item['Name'], 'is_delete' => 0, 'access_key' => $config['accessKey']], 'id'))) {
|
|
|
- $this->dao->update($id, [
|
|
|
+ if (($id = $this->getOneValue(['name' => $item['Name'], 'is_delete' => 0, 'access_key' => $config['accessKey']], 'id'))) {
|
|
|
+ $this->update($id, [
|
|
|
'update_time' => time(),
|
|
|
'region' => $item['Location'],
|
|
|
'name' => $item['Name'],
|
|
@@ -360,7 +360,7 @@ class SystemStorageServices extends BaseServices
|
|
|
{
|
|
|
$res = ['name' => '', 'region' => '', 'domain' => ''];
|
|
|
try {
|
|
|
- $config = $this->dao->get(['type' => $type, 'status' => 1, 'is_delete' => 0]);
|
|
|
+ $config = $this->get(['type' => $type, 'status' => 1, 'is_delete' => 0]);
|
|
|
if ($config) {
|
|
|
return ['name' => $config->name, 'region' => $config->region, 'domain' => $config->domain];
|
|
|
}
|