feat: product search
This commit is contained in:
		@@ -1,5 +1,3 @@
 | 
			
		||||
from typing import Union
 | 
			
		||||
 | 
			
		||||
from fastapi import HTTPException
 | 
			
		||||
from sqlalchemy import select, func, Integer, update, or_
 | 
			
		||||
from sqlalchemy.orm import selectinload, Query
 | 
			
		||||
@@ -7,7 +5,6 @@ from sqlalchemy.orm import selectinload, Query
 | 
			
		||||
import utils.barcodes
 | 
			
		||||
from backend import config
 | 
			
		||||
from external.s3_uploader.uploader import S3Uploader
 | 
			
		||||
from models import User
 | 
			
		||||
from models.product import Product, ProductImage
 | 
			
		||||
from schemas.base import PaginationSchema
 | 
			
		||||
from schemas.product import *
 | 
			
		||||
@@ -124,7 +121,7 @@ class ProductService(BaseService):
 | 
			
		||||
                    or_(
 | 
			
		||||
                        Product.name.ilike(f'%{search_input}%'),
 | 
			
		||||
                        Product.barcodes.any(ProductBarcode.barcode == search_input),
 | 
			
		||||
                        Product.article == search_input
 | 
			
		||||
                        Product.article.ilike(f'%{search_input}%')
 | 
			
		||||
                    )
 | 
			
		||||
                )
 | 
			
		||||
            )
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user