diff options
| author | MHSanaei <33454419+MHSanaei@users.noreply.github.com> | 2023-03-24 16:38:30 +0300 |
|---|---|---|
| committer | MHSanaei <33454419+MHSanaei@users.noreply.github.com> | 2023-03-24 16:38:30 +0300 |
| commit | a6dfdcdd316f53444a30ae7fa6038f252f1b20b7 (patch) | |
| tree | 259fb2b488602008bfe976c4aa03b8ac23446af7 /web/service/inbound.go | |
| parent | 03a6c131f994e0d7984b07b153acc6a6ca943f10 (diff) | |
Add version and log
Diffstat (limited to 'web/service/inbound.go')
| -rw-r--r-- | web/service/inbound.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/web/service/inbound.go b/web/service/inbound.go index b6f4f031..9814b549 100644 --- a/web/service/inbound.go +++ b/web/service/inbound.go @@ -634,3 +634,13 @@ func (s *InboundService) ClearClientIps(clientEmail string) error { } return nil } + +func (s *InboundService) SearchInbounds(query string) ([]*model.Inbound, error) { + db := database.GetDB() + var inbounds []*model.Inbound + err := db.Model(model.Inbound{}).Preload("ClientStats").Where("remark like ?", "%"+query+"%").Find(&inbounds).Error + if err != nil && err != gorm.ErrRecordNotFound { + return nil, err + } + return inbounds, nil +}
\ No newline at end of file |
