mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-17 18:55:02 +00:00
traffic fix
drag preview styling
This commit is contained in:
@@ -7,6 +7,4 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Traffic extends Model
|
||||
{
|
||||
protected $fillable = ['user_id', 'upload', 'download'];
|
||||
|
||||
protected $primaryKey = null;
|
||||
}
|
||||
|
||||
+9
-3
@@ -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,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user