array(12) { [244]=> array(20) { ["additionalInfo"]=> NULL ["carbohydrateAmount"]=> int(0) ["carbohydrateFullAmount"]=> int(0) ["code"]=> string(5) "02137" ["description"]=> string(0) "" ["doNotPrintInCheque"]=> bool(false) ["energyAmount"]=> int(0) ["energyFullAmount"]=> int(0) ["groupId"]=> NULL ["id"]=> string(36) "61b145ad-053d-4a62-bc03-e6ed34ae40f1" ["images"]=> array(0) { } ["isDeleted"]=> bool(false) ["name"]=> string(46) "Пицца Горная 25 см подарок" ["order"]=> int(0) ["parentGroup"]=> string(36) "b28d65da-236f-4dd9-ba71-b3cd0e1cd297" ["price"]=> int(0) ["productCategoryId"]=> string(36) "0a722a84-7fd0-f579-015c-6d177e6d010d" ["tags"]=> NULL ["type"]=> string(4) "dish" ["weight"]=> float(0.434) } [245]=> array(20) { ["additionalInfo"]=> NULL ["carbohydrateAmount"]=> int(0) ["carbohydrateFullAmount"]=> int(0) ["code"]=> string(5) "02145" ["description"]=> string(0) "" ["doNotPrintInCheque"]=> bool(false) ["energyAmount"]=> int(0) ["energyFullAmount"]=> int(0) ["groupId"]=> NULL ["id"]=> string(36) "7e72e231-54e7-41c5-a0c7-016c7bd2ef0d" ["images"]=> array(0) { } ["isDeleted"]=> bool(false) ["name"]=> string(56) "Пицца Деревенская 25 см подарок" ["order"]=> int(1) ["parentGroup"]=> string(36) "b28d65da-236f-4dd9-ba71-b3cd0e1cd297" ["price"]=> int(0) ["productCategoryId"]=> string(36) "0a722a84-7fd0-f579-015c-6d177e6d010d" ["tags"]=> NULL ["type"]=> string(4) "dish" ["weight"]=> float(0.499) } [246]=> array(20) { ["additionalInfo"]=> NULL ["carbohydrateAmount"]=> int(0) ["carbohydrateFullAmount"]=> int(0) ["code"]=> string(5) "02146" ["description"]=> string(0) "" ["doNotPrintInCheque"]=> bool(false) ["energyAmount"]=> int(0) ["energyFullAmount"]=> int(0) ["groupId"]=> NULL ["id"]=> string(36) "26863644-2663-49e8-b8be-27cf7c059e41" ["images"]=> array(0) { } ["isDeleted"]=> bool(false) ["name"]=> string(48) "Пицца Капрезе 25 см подарок" ["order"]=> int(2) ["parentGroup"]=> string(36) "b28d65da-236f-4dd9-ba71-b3cd0e1cd297" ["price"]=> int(0) ["productCategoryId"]=> string(36) "0a722a84-7fd0-f579-015c-6d177e6d010d" ["tags"]=> NULL ["type"]=> string(4) "dish" ["weight"]=> float(0.479) } [247]=> array(20) { ["additionalInfo"]=> NULL ["carbohydrateAmount"]=> int(0) ["carbohydrateFullAmount"]=> int(0) ["code"]=> string(5) "01577" ["description"]=> string(0) "" ["doNotPrintInCheque"]=> bool(false) ["energyAmount"]=> int(0) ["energyFullAmount"]=> int(0) ["groupId"]=> NULL ["id"]=> string(36) "12ada6a8-e959-4937-b8aa-5b81e901ccbc" ["images"]=> array(0) { } ["isDeleted"]=> bool(false) ["name"]=> string(51) "Пицца Сальчичон 25см подарок" ["order"]=> int(3) ["parentGroup"]=> string(36) "b28d65da-236f-4dd9-ba71-b3cd0e1cd297" ["price"]=> int(0) ["productCategoryId"]=> string(36) "0a722a84-7fd0-f579-015c-6d177e6d010d" ["tags"]=> NULL ["type"]=> string(4) "dish" ["weight"]=> float(0.414) } [248]=> array(20) { ["additionalInfo"]=> NULL ["carbohydrateAmount"]=> int(0) ["carbohydrateFullAmount"]=> int(0) ["code"]=> string(5) "00819" ["description"]=> string(0) "" ["doNotPrintInCheque"]=> bool(false) ["energyAmount"]=> int(0) ["energyFullAmount"]=> int(0) ["groupId"]=> NULL ["id"]=> string(36) "5eb11453-99d6-4384-9b76-c4d2f3db05c4" ["images"]=> array(0) { } ["isDeleted"]=> bool(false) ["name"]=> string(39) "Сок Ананас 1 л подарок" ["order"]=> int(4) ["parentGroup"]=> string(36) "b28d65da-236f-4dd9-ba71-b3cd0e1cd297" ["price"]=> int(0) ["productCategoryId"]=> string(36) "1024f288-3ed0-11ac-015c-a57fa20a65dc" ["tags"]=> NULL ["type"]=> string(4) "dish" ["weight"]=> int(1) } [249]=> array(20) { ["additionalInfo"]=> NULL ["carbohydrateAmount"]=> int(0) ["carbohydrateFullAmount"]=> int(0) ["code"]=> string(5) "00820" ["description"]=> string(0) "" ["doNotPrintInCheque"]=> bool(false) ["energyAmount"]=> int(0) ["energyFullAmount"]=> int(0) ["groupId"]=> NULL ["id"]=> string(36) "cc520625-687a-4a66-b1a3-7966ecdd1c18" ["images"]=> array(0) { } ["isDeleted"]=> bool(false) ["name"]=> string(43) "Сок Апельсин 1 л подарок" ["order"]=> int(5) ["parentGroup"]=> string(36) "b28d65da-236f-4dd9-ba71-b3cd0e1cd297" ["price"]=> int(0) ["productCategoryId"]=> string(36) "1024f288-3ed0-11ac-015c-a57fa20a65dc" ["tags"]=> NULL ["type"]=> string(4) "dish" ["weight"]=> int(1) } [250]=> array(20) { ["additionalInfo"]=> NULL ["carbohydrateAmount"]=> int(0) ["carbohydrateFullAmount"]=> int(0) ["code"]=> string(5) "00821" ["description"]=> string(0) "" ["doNotPrintInCheque"]=> bool(false) ["energyAmount"]=> int(0) ["energyFullAmount"]=> int(0) ["groupId"]=> NULL ["id"]=> string(36) "a206fa15-bc66-49bd-bb8f-2a28a7184d50" ["images"]=> array(0) { } ["isDeleted"]=> bool(false) ["name"]=> string(37) "Сок Вишня 1 л подарок" ["order"]=> int(6) ["parentGroup"]=> string(36) "b28d65da-236f-4dd9-ba71-b3cd0e1cd297" ["price"]=> int(0) ["productCategoryId"]=> string(36) "1024f288-3ed0-11ac-015c-a57fa20a65dc" ["tags"]=> NULL ["type"]=> string(4) "dish" ["weight"]=> int(1) } [251]=> array(20) { ["additionalInfo"]=> NULL ["carbohydrateAmount"]=> int(0) ["carbohydrateFullAmount"]=> int(0) ["code"]=> string(5) "00823" ["description"]=> string(0) "" ["doNotPrintInCheque"]=> bool(false) ["energyAmount"]=> int(0) ["energyFullAmount"]=> int(0) ["groupId"]=> NULL ["id"]=> string(36) "5b816e8f-0910-4aa0-a38d-a80180778a27" ["images"]=> array(0) { } ["isDeleted"]=> bool(false) ["name"]=> string(39) "Сок Персик 1 л подарок" ["order"]=> int(7) ["parentGroup"]=> string(36) "b28d65da-236f-4dd9-ba71-b3cd0e1cd297" ["price"]=> int(0) ["productCategoryId"]=> string(36) "1024f288-3ed0-11ac-015c-a57fa20a65dc" ["tags"]=> NULL ["type"]=> string(4) "dish" ["weight"]=> int(1) } [252]=> array(20) { ["additionalInfo"]=> NULL ["carbohydrateAmount"]=> int(0) ["carbohydrateFullAmount"]=> int(0) ["code"]=> string(5) "01819" ["description"]=> string(0) "" ["doNotPrintInCheque"]=> bool(false) ["energyAmount"]=> int(0) ["energyFullAmount"]=> int(0) ["groupId"]=> NULL ["id"]=> string(36) "892d01dd-adf6-4950-97bb-fd13b02cf7d2" ["images"]=> array(0) { } ["isDeleted"]=> bool(false) ["name"]=> string(68) "Арахис жаренный соленый 100 гр подарок" ["order"]=> int(8) ["parentGroup"]=> string(36) "b28d65da-236f-4dd9-ba71-b3cd0e1cd297" ["price"]=> int(0) ["productCategoryId"]=> string(36) "1024f288-3ed0-11ac-015c-a57fa20a6591" ["tags"]=> NULL ["type"]=> string(4) "dish" ["weight"]=> float(0.1) } [253]=> array(20) { ["additionalInfo"]=> NULL ["carbohydrateAmount"]=> int(0) ["carbohydrateFullAmount"]=> int(0) ["code"]=> string(5) "01824" ["description"]=> string(0) "" ["doNotPrintInCheque"]=> bool(false) ["energyAmount"]=> int(0) ["energyFullAmount"]=> int(0) ["groupId"]=> NULL ["id"]=> string(36) "d41963be-420b-4366-8cd9-2ebf9345f8aa" ["images"]=> array(0) { } ["isDeleted"]=> bool(false) ["name"]=> string(61) "Фисташки Американка 100 гр подарок" ["order"]=> int(9) ["parentGroup"]=> string(36) "b28d65da-236f-4dd9-ba71-b3cd0e1cd297" ["price"]=> int(0) ["productCategoryId"]=> string(36) "1024f288-3ed0-11ac-015c-a57fa20a6591" ["tags"]=> NULL ["type"]=> string(4) "dish" ["weight"]=> float(0.1) } [254]=> array(20) { ["additionalInfo"]=> NULL ["carbohydrateAmount"]=> int(0) ["carbohydrateFullAmount"]=> int(0) ["code"]=> string(5) "02140" ["description"]=> string(0) "" ["doNotPrintInCheque"]=> bool(false) ["energyAmount"]=> int(0) ["energyFullAmount"]=> int(0) ["groupId"]=> NULL ["id"]=> string(36) "c0a0a39a-f6c0-428b-a4b3-7b12861475f9" ["images"]=> array(0) { } ["isDeleted"]=> bool(false) ["name"]=> string(58) "Салат с куриной печенью подарок" ["order"]=> int(10) ["parentGroup"]=> string(36) "b28d65da-236f-4dd9-ba71-b3cd0e1cd297" ["price"]=> int(0) ["productCategoryId"]=> string(36) "0901ce29-8e8a-80cc-015c-81d630c400dc" ["tags"]=> NULL ["type"]=> string(4) "dish" ["weight"]=> float(0.252964) } [255]=> array(20) { ["additionalInfo"]=> NULL ["carbohydrateAmount"]=> int(0) ["carbohydrateFullAmount"]=> int(0) ["code"]=> string(5) "02139" ["description"]=> string(0) "" ["doNotPrintInCheque"]=> bool(false) ["energyAmount"]=> int(0) ["energyFullAmount"]=> int(0) ["groupId"]=> NULL ["id"]=> string(36) "2ba03ced-48ba-47b3-bfda-a5c892cf99d0" ["images"]=> array(0) { } ["isDeleted"]=> bool(false) ["name"]=> string(38) "Салат Фитнес подарок" ["order"]=> int(11) ["parentGroup"]=> string(36) "b28d65da-236f-4dd9-ba71-b3cd0e1cd297" ["price"]=> int(0) ["productCategoryId"]=> string(36) "0901ce29-8e8a-80cc-015c-81d630c400dc" ["tags"]=> NULL ["type"]=> string(4) "dish" ["weight"]=> float(0.235) } }
Array
(
[additionalInfo] =>
[code] => 02079
[description] => Основа из теста со сливочным соусом и сыром "Моцарелла". Добавьте топпинг по вкусу.
[id] => dca00012-cd15-4eff-9681-aa4c67e75b8c
[isDeleted] =>
[name] => Основа Сливочная
[seoDescription] =>
[seoKeywords] =>
[seoText] =>
[seoTitle] =>
[tags] =>
[carbohydrateAmount] => 0
[carbohydrateFullAmount] => 0
[differentPricesOn] => Array
(
)
[doNotPrintInCheque] =>
[energyAmount] => 0
[energyFullAmount] => 0
[fatAmount] => 0
[fatFullAmount] => 0
[fiberAmount] => 0
[fiberFullAmount] => 0
[groupId] =>
[groupModifiers] => Array
(
[0] => Array
(
[maxAmount] => 1
[minAmount] => 1
[modifierId] => 8aac3619-f512-41e7-aa17-fbb73652fc1b
[required] => 1
[childModifiers] => Array
(
[0] => Array
(
[maxAmount] => 0
[minAmount] => 0
[modifierId] => 83383181-eb25-4570-a1eb-a8845c05054c
[required] =>
[defaultAmount] => 0
[hideIfDefaultAmount] =>
)
[1] => Array
(
[maxAmount] => 0
[minAmount] => 0
[modifierId] => c8a57301-78df-4998-9df8-ac229a8c5a3d
[required] =>
[defaultAmount] => 0
[hideIfDefaultAmount] =>
)
[2] => Array
(
[maxAmount] => 0
[minAmount] => 0
[modifierId] => a56534e5-33b8-461b-9e87-36acfab1a11d
[required] =>
[defaultAmount] => 0
[hideIfDefaultAmount] =>
)
)
[childModifiersHaveMinMaxRestrictions] =>
)
[1] => Array
(
[maxAmount] => 10
[minAmount] => 3
[modifierId] => 60c0e31b-b385-400d-9bb4-0bc228d6de70
[required] => 1
[childModifiers] => Array
(
[0] => Array
(
[maxAmount] => 0
[minAmount] => 0
[modifierId] => bf1c8aac-a5d4-4fd1-b7d4-1ef69e79a113
[required] =>
[defaultAmount] => 0
[hideIfDefaultAmount] =>
)
[1] => Array
(
[maxAmount] => 0
[minAmount] => 0
[modifierId] => 7f8dba99-a149-4082-ae72-96a85582b7d3
[required] =>
[defaultAmount] => 0
[hideIfDefaultAmount] =>
)
)
[childModifiersHaveMinMaxRestrictions] =>
)
[2] => Array
(
[maxAmount] => 10
[minAmount] => 0
[modifierId] => 54ea3598-22d0-4e57-b691-db93a741d46d
[required] =>
[childModifiers] => Array
(
[0] => Array
(
[maxAmount] => 0
[minAmount] => 0
[modifierId] => 0464ec62-66d6-4293-9d79-19dc02a59216
[required] =>
[defaultAmount] => 0
[hideIfDefaultAmount] =>
)
[1] => Array
(
[maxAmount] => 0
[minAmount] => 0
[modifierId] => 3964f872-2415-44cf-b312-5c8674946244
[required] =>
[defaultAmount] => 0
[hideIfDefaultAmount] =>
)
)
[childModifiersHaveMinMaxRestrictions] =>
)
)
[measureUnit] => порц
[modifiers] => Array
(
)
[price] => 0
[productCategoryId] => 0a722a84-7fd0-f579-015c-6d177e6d0598
[prohibitedToSaleOn] => Array
(
)
[type] => dish
[useBalanceForSell] =>
[weight] => 0
[images] => Array
(
[0] => Array
(
[imageId] => b57afa7b-8246-4042-8915-f50ca49b2b80
[imageUrl] => https://site.com/image.png
[uploadDate] => 2020-11-28 19:21:32
)
)
[isIncludedInMenu] => 1
[order] => 1
[parentGroup] => 632e6fc0-4133-49bf-b4f0-e88f26088e8e
[warningType] => 0
)
foreach ($products as $key => $product) {
print_r($product);
die;
if ($product['productCategoryId'] == self::category) {
protected function sortGiftProducts($products)
{
$data = [];
foreach ($products as $key => $product) {
if($product['productCategoryId'] === self::category) {
$data[$key]['code'] = $product['code'];
$data[$key]['id'] = $product['id'];
$data[$key]['parentGroup'] = $product['parentGroup'];
$data[$key]['price'] = $product['price'];
$data[$key]['productCategoryId'] = $product['productCategoryId'];
$data[$key]['images'] = $product['images'];
}
}
return $data;
}
SELECT * FROM searchhistory ORDER BY id DESC LIMIT 10