fixes
This commit is contained in:
@@ -6,9 +6,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
use Staudenmeir\EloquentHasManyDeep\HasRelationships;
|
||||
use BeyondCode\Comments\Traits\HasComments;
|
||||
use Kirschbaum\PowerJoins\PowerJoins;
|
||||
|
||||
class Tariff extends Model
|
||||
{
|
||||
use HasComments, HasRelationships;
|
||||
use HasComments, HasRelationships, PowerJoins;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'shop_tariffs';
|
||||
@@ -27,4 +29,14 @@ class Tariff extends Model
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\PriceList');
|
||||
}
|
||||
|
||||
public function scopeBySaleChanel($query, $id)
|
||||
{
|
||||
return $query->where($this->table . '.sale_channel_id', $id);
|
||||
}
|
||||
|
||||
public function scopeByStatus($query, $id)
|
||||
{
|
||||
return $query->where($this->table . '.status_id', $id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user