fix:Invalid post search criteria

This commit is contained in:
zhangwenjian committed 2020-07-11 06:34:51 +08:00
1 parent 494ee18b9f
commit 2280ce2b57
2 files changed
+18 -14

No files matched your search

+3
View File
@@ -90,6 +90,9 @@ func (e *Post) GetPage(pageSize int, pageIndex int) ([]Post, int, error) {
if e.PostName != "" {
table = table.Where("post_name = ?", e.PostName)
}
if e.PostCode != "" {
table = table.Where("post_code = ?", e.PostCode)
}
if e.Status != "" {
table = table.Where("status = ?", e.Status)
}