Fix showing all traffic usage for broadband
This commit is contained in:
parent
7e784c3e81
commit
23f23dfe40
@ -52,9 +52,7 @@ class Broadband extends Type implements ServiceUsage
|
||||
*/
|
||||
public function traffic()
|
||||
{
|
||||
return $this->hasMany(UsageBroadband::class,'service_item_id')
|
||||
->where('date','>=',Carbon::now()->startOfMonth());
|
||||
//->where('site_id',$this->site_id);
|
||||
return $this->hasMany(UsageBroadband::class,'service_item_id');
|
||||
}
|
||||
|
||||
/* ATTRIBUTES */
|
||||
@ -144,9 +142,11 @@ class Broadband extends Type implements ServiceUsage
|
||||
*/
|
||||
private function usage_last_date(): ?UsageBroadband
|
||||
{
|
||||
return $this->traffic
|
||||
->sortBy('date')
|
||||
->last();
|
||||
return $this->traffic()
|
||||
->orderBy('date','DESC')
|
||||
->limit(1)
|
||||
->get()
|
||||
->first();
|
||||
}
|
||||
|
||||
public function usage_summary(int $months=2): Collection
|
||||
|
Loading…
Reference in New Issue
Block a user