feat : oss
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use App\Constants\Common\OssObjectCode;
|
||||
use Hyperf\Collection\Collection;
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
use function Hyperf\Config\config;
|
||||
@@ -69,7 +70,7 @@ class OssObject extends Model
|
||||
*/
|
||||
public function updateEnabledByIds(array $ids): int
|
||||
{
|
||||
return $this->whereIn('id', $ids)->update(['is_enabled' => 1]);
|
||||
return $this->whereIn('id', $ids)->update(['is_enabled' => OssObjectCode::ENABLE]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,7 +80,7 @@ class OssObject extends Model
|
||||
*/
|
||||
public function updateDisableByIds(array $ids): int
|
||||
{
|
||||
return $this->whereIn('id', $ids)->update(['is_enabled' => 0]);
|
||||
return $this->whereIn('id', $ids)->update(['is_enabled' => OssObjectCode::DISABLE]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,7 +101,7 @@ class OssObject extends Model
|
||||
public function getOssIdListByIsEnabled($time): Collection|false
|
||||
{
|
||||
return $this->where([
|
||||
['is_enabled', '=', 0],
|
||||
['is_enabled', '=', OssObjectCode::DISABLE],
|
||||
['create_time', '<',$time]
|
||||
])->pluck('id') ?? false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user