SELECT p.*
FROM products p
INNER JOIN filters_products fp1 ON p.id = fp1.product_id
INNER JOIN filters_products fp2 ON p.id = fp2.product_id
INNER JOIN filters_products fp3 ON p.id = fp3.product_id
WHERE fp1.filter_id = 1 AND fp1.filter_value BETWEEN 1000 AND 4000
AND fp2.filter_id = 3 AND fp2.filter_value IN ('Intel® Core™ i5 11400F', 'AMD Ryzen 5 5600G')
AND fp3.filter_id = 2 AND fp3.filter_value = 6;
$category_id = $request->input('category_id');
$products = Product::whereHas('categories', function ($query) use ($category_id) {
$query->where('title', $category_id);
})->with('categories')->get();
helper_thread = Thread(target=helper)
helper_thread.start()
window_thread = Thread(target=window)
window_thread.start()
using System;
using System.Runtime.InteropServices;
class Stack {
private int* topPointer_;
private void* guardPage_;
public unsafe Stack() {
topPointer_ = null;
// Выделение виртуальной страницы памяти с запретом записи после стека
guardPage_ = VirtualAlloc((IntPtr)null, sizeof(int), 0x1000, 0x04);
if (guardPage_ == null) {
// Обработка ошибки
}
}
~Stack() {
// Освобождение виртуальной страницы памяти
VirtualFree(guardPage_, 0, 0x8000);
}
public unsafe int* TopPointer {
get { return topPointer_; }
set {
topPointer_ = value;
// Проверка, не вышел ли указатель за границы стека
if ((byte*)topPointer_ >= (byte*)guardPage_ && (byte*)topPointer_ < (byte*)guardPage_ + sizeof(int)) {
// Обработка ошибки
}
}
}
[DllImport("Kernel32.dll", SetLastError = true)]
private static extern void* VirtualAlloc(IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);
[DllImport("Kernel32.dll", SetLastError = true)]
private static extern bool VirtualFree(void* lpAddress, uint dwSize, uint dwFreeType);
}