Remove 'total' & 'traffic' in dataflow database table

This commit is contained in:
BrettonYe
2023-07-22 16:42:37 +08:00
committed by BrettonYe
parent b5c04f34ae
commit 226e1dfdec
22 changed files with 229 additions and 160 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -28,13 +29,17 @@ class UserDataModifyLog extends Model
return $this->belongsTo(Order::class);
}
public function getBeforeAttribute($value): string
public function before(): Attribute
{
return $this->attributes['before'] = formatBytes($value);
return Attribute::make(
get: static fn (int $value) => formatBytes($value),
);
}
public function getAfterAttribute($value): string
public function after(): Attribute
{
return $this->attributes['after'] = formatBytes($value);
return Attribute::make(
get: static fn (int $value) => formatBytes($value),
);
}
}