Descripción
function get_products(array $filters = [], int $limit = 12, int $offset = 0): array {
$where = ["estatus = 'activo'"];
$params = [];
// Filtro por categoría
if (!empty($filters['categoria'])) {
$where[] = "p.categoria_id = ?";
$params[] = $filters['categoria'];
}
// Filtro por búsqueda
if (!empty($filters['search'])) {
$where[] = "(titulo LIKE ? OR descripcion LIKE ?)";
$search = '%' . $filters['search'] . '%';
$params[] = $search;
$params[] = $search;
Vendedor
emprendedor emprendedor
naiguata