fix:Invalid post search criteria

This commit is contained in:
zhangwenjian
2020-07-11 06:34:51 +08:00
parent 494ee18b9f
commit 2280ce2b57
2 changed files with 18 additions and 14 deletions
+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)
}