traffic fix

drag preview styling
This commit is contained in:
Peter Papp
2020-11-29 09:39:26 +01:00
parent e86ea3e5c4
commit 1981f39f9e
5 changed files with 16 additions and 13 deletions

View File

@@ -260,7 +260,10 @@ class User extends Authenticatable
*/
public function record_upload($file_size)
{
$record = Traffic::whereMonth('created_at', '=', Carbon::now()->month)
$now = Carbon::now();
$record = Traffic::whereYear('created_at', '=', $now->year)
->whereMonth('created_at', '=', $now->month)
->firstOrCreate([
'user_id' => $this->id,
]);
@@ -269,7 +272,7 @@ class User extends Authenticatable
'upload' => $record->upload + $file_size
]);
}
/**
* Record user download filesize
*
@@ -277,7 +280,10 @@ class User extends Authenticatable
*/
public function record_download($file_size)
{
$record = Traffic::whereMonth('created_at', '=', Carbon::now()->month)
$now = Carbon::now();
$record = Traffic::whereYear('created_at', '=', $now->year)
->whereMonth('created_at', '=', $now->month)
->firstOrCreate([
'user_id' => $this->id,
]);