胡轶钦 6 years ago
parent
commit
5be2d48386
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      models/book/book.go

+ 3
- 3
models/book/book.go View File

152
 		sql += ` and a.borrow_status = '` + borrowStatus + `' `
152
 		sql += ` and a.borrow_status = '` + borrowStatus + `' `
153
 	}
153
 	}
154
 	if customerName != "" {
154
 	if customerName != "" {
155
-		sql += ` and a.customer_name = '` + customerName + `' `
155
+		sql += ` and a.customer_name like '%` + customerName + `%' `
156
 	}
156
 	}
157
 	if customerPhone != "" {
157
 	if customerPhone != "" {
158
-		sql += ` and a.customer_phone ='` + customerPhone + `' `
158
+		sql += ` and a.customer_phone like'%` + customerPhone + `%' `
159
 	}
159
 	}
160
 	if bookName != "" {
160
 	if bookName != "" {
161
-		sql += ` and b.book_name = '` + bookName + `' `
161
+		sql += ` and (b.book_name like '%` + bookName + `%')`
162
 	}
162
 	}
163
 	if barcode != "" {
163
 	if barcode != "" {
164
 		sql += ` and b.book_barcode = '` + barcode + `'`
164
 		sql += ` and b.book_barcode = '` + barcode + `'`