Added usage graph (ADSL), improved logging for usage collection (ADSL)
This commit is contained in:
@@ -28,6 +28,8 @@ class Product extends Model
|
||||
|
||||
protected $with = ['descriptions'];
|
||||
|
||||
/* RELATIONS */
|
||||
|
||||
public function descriptions()
|
||||
{
|
||||
return $this->hasMany(ProductTranslate::class);
|
||||
@@ -48,6 +50,8 @@ class Product extends Model
|
||||
return $this->morphTo(null,'model','prod_plugin_data');
|
||||
}
|
||||
|
||||
/* ATTRIBUTES */
|
||||
|
||||
/**
|
||||
* Get the service category (from the product)
|
||||
*
|
||||
@@ -161,6 +165,17 @@ class Product extends Model
|
||||
return Arr::get($this->price_array,sprintf('%s.1.price_setup',$this->price_recurr_default))*1.1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if this product captures usage data
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasUsage(): bool
|
||||
{
|
||||
// @todo This should be configured in the DB
|
||||
return in_array($this->model, ['App\Models\Product\Adsl']);
|
||||
}
|
||||
|
||||
public function scopeActive()
|
||||
{
|
||||
return $this->where('active',TRUE);
|
||||
|
Reference in New Issue
Block a user