diff --git a/app/Models/Shop/PriceListValue.php b/app/Models/Shop/PriceListValue.php index 9c34cf25..6750129d 100644 --- a/app/Models/Shop/PriceListValue.php +++ b/app/Models/Shop/PriceListValue.php @@ -41,6 +41,6 @@ class PriceListValue extends Model public function scopeByQuantity($query, $quantity) { - return $query->orderBy('quantity', 'desc')->where($this->table . '.quantity', '<', $quantity)->first(); + return $query->orderBy('quantity', 'desc')->where($this->table . '.quantity', '<=', $quantity)->first(); } } diff --git a/app/Models/Shop/Shelve.php b/app/Models/Shop/Shelve.php index 0f630346..2bdc71c3 100644 --- a/app/Models/Shop/Shelve.php +++ b/app/Models/Shop/Shelve.php @@ -10,7 +10,7 @@ class Shelve extends Model use HasRelationships; protected $guarded = ['id']; - protected $table = 'shop_categories'; + protected $table = 'categories'; public function articles() {