Get the related books directly from DB by SQL composed with Labels
(book *Book, length int)
| 118 | |
| 119 | // Get the related books directly from DB by SQL composed with Labels |
| 120 | func listByDBWithLabel(book *Book, length int) (ids []int) { |
| 121 | rawKeyWords := book.Label |
| 122 | if rawKeyWords == "" { |
| 123 | return |
| 124 | } |
| 125 | |
| 126 | bookModel := NewBook() |
| 127 | ids, _ = bookModel.SearchBookByLabel(strings.Split(rawKeyWords, ","), length, []int{book.BookId}) |
| 128 | return |
| 129 | } |
no test coverage detected