From 81b6c87d59d25b7d3a8ad0446ded54c8471be395 Mon Sep 17 00:00:00 2001 From: Ludovic CANDELLIER Date: Sun, 23 Jan 2022 21:48:37 +0100 Subject: [PATCH] fixes --- app/Models/Shop/PriceListValue.php | 2 +- app/Models/Shop/Shelve.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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() {