Minor fixes, coding standards
This commit is contained in:
@@ -5,7 +5,7 @@ namespace App\Models\Shop;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
use Staudenmeir\EloquentHasManyDeep\HasRelationships;
|
||||
use Kirschbaum\PowerJoins\PowerJoins;
|
||||
use Kirschbaum\PowerJoins\PowerJoins;
|
||||
|
||||
use App\Traits\HasComments;
|
||||
|
||||
@@ -31,6 +31,13 @@ class Tariff extends Model
|
||||
return $this->hasMany(PriceList::class);
|
||||
}
|
||||
|
||||
public function scopeByAutocomplete($query, $str)
|
||||
{
|
||||
return $query->where($this->table . '.name', 'LIKE', "%${str}%")
|
||||
->orWhere($this->table . '.ref', 'LIKE', "${str}%")
|
||||
->orWhere($this->table . '.code', 'LIKE', "${str}%");
|
||||
}
|
||||
|
||||
public function scopeBySaleChanel($query, $id)
|
||||
{
|
||||
return $query->where($this->table . '.sale_channel_id', $id);
|
||||
|
||||
Reference in New Issue
Block a user