Again some changes for the new product-by-barcode API method (references #171)

This commit is contained in:
Bernd Bestel 2019-03-10 14:53:06 +01:00
parent 27ba2bfd55
commit 9d02fbc13c
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -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)
{