chore: update book enabled status wiring

This commit is contained in:
2026-04-27 11:41:35 +08:00
parent 93bde0a6b6
commit 67c33d06be
25 changed files with 336 additions and 122 deletions

View File

@@ -14,7 +14,7 @@ func (s *BookAuthorService) CreateBookAuthor(item book.BookAuthor) error {
if err := validateBookAuthor(item); err != nil {
return err
}
return global.GVA_DB.Create(&item).Error
return global.GVA_DB.Save(&item).Error
}
func (s *BookAuthorService) DeleteBookAuthor(item book.BookAuthor) error {
@@ -45,8 +45,8 @@ func (s *BookAuthorService) GetBookAuthorInfoList(info bookReq.BookAuthorSearch)
if info.Keyword != "" {
db = db.Where("name LIKE ?", "%"+info.Keyword+"%")
}
if info.AuthorStatus != "" {
db = db.Where("author_status = ?", info.AuthorStatus)
if info.IsEnabled != nil {
db = db.Where("is_enabled = ?", *info.IsEnabled)
}
err = db.Count(&total).Error
if err != nil {