mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-24 15:25:43 +00:00
feat: add more filters
This commit is contained in:
@@ -129,6 +129,9 @@ func (s productStockService) GetAll(c *fiber.Ctx, params *validation.Query) ([]e
|
||||
if params.Search != "" {
|
||||
db = db.Where("products.name ILIKE ?", "%"+params.Search+"%")
|
||||
}
|
||||
if params.ProductCategoryID > 0 {
|
||||
db = db.Where("products.product_category_id = ?", params.ProductCategoryID)
|
||||
}
|
||||
return db.Order("products.created_at DESC").Order("products.updated_at DESC")
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user