胡轶钦 6 jaren geleden
bovenliggende
commit
5be2d48386
1 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 3
    3
      models/book/book.go

+ 3
- 3
models/book/book.go Bestand weergeven

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