admin add claim

This commit is contained in:
xiaomlove
2022-07-02 15:08:23 +08:00
parent 579351c0eb
commit 5191a1ba9a
48 changed files with 992 additions and 293 deletions

View File

@@ -35,6 +35,10 @@ class Snatch extends NexusModel
const FINISHED_NO = 'no';
/**
* @deprecated Use uploadedText instead
* @return Attribute
*/
protected function uploadText(): Attribute
{
return new Attribute(
@@ -42,6 +46,10 @@ class Snatch extends NexusModel
);
}
/**
* @deprecated Use downloadedText instead
* @return Attribute
*/
protected function downloadText(): Attribute
{
return new Attribute(
@@ -49,6 +57,20 @@ class Snatch extends NexusModel
);
}
protected function uploadedText(): Attribute
{
return new Attribute(
get: fn($value, $attributes) => sprintf('%s@%s', mksize($attributes['uploaded']), $this->getUploadSpeed())
);
}
protected function downloadedText(): Attribute
{
return new Attribute(
get: fn($value, $attributes) => sprintf('%s@%s', mksize($attributes['downloaded']), $this->getDownloadSpeed())
);
}
protected function shareRatio(): Attribute
{
return new Attribute(