mirror of
https://github.com/grocy/grocy.git
synced 2025-08-28 17:10:11 +00:00
Again some changes for the new product-by-barcode API method (references #171)
This commit is contained in:
@@ -40,7 +40,7 @@ class StockService extends BaseService
|
||||
|
||||
public function GetProductIdFromBarcode(string $barcode)
|
||||
{
|
||||
$potentialProduct = $this->Database->products()->where('barcode LIKE :1', '%' . $barcode . '%')->limit(1)->fetch();
|
||||
$potentialProduct = $this->Database->products()->where("',' || barcode || ',' LIKE '%,' || :1 || ',%' AND IFNULL(barcode, '') != ''", $barcode)->limit(1)->fetch();
|
||||
|
||||
if ($potentialProduct === null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user