fix pagination and search
This commit is contained in:
@@ -8,10 +8,12 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func SearchCodeOrName(search string, tx *gorm.DB) {
|
||||
func SearchCodeOrName(search string, tx *gorm.DB) *gorm.DB {
|
||||
if search != "" {
|
||||
tx.Where("\"Code\" ILIKE ? OR \"Name\" ILIKE ?", "%"+search+"%", "%"+search+"%")
|
||||
tx = tx.Where("\"Code\" ILIKE ? OR \"Name\" ILIKE ?", "%"+search+"%", "%"+search+"%")
|
||||
}
|
||||
|
||||
return tx
|
||||
}
|
||||
|
||||
func HandleCreateError(input any, event *pl.Event, err error) error {
|
||||
|
||||
Reference in New Issue
Block a user