mirror of
https://github.com/grocy/grocy.git
synced 2025-09-18 18:46:51 +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)
|
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)
|
if ($potentialProduct === null)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user