后台:商户列表名称和联系人搜索不区分大小写

This commit is contained in:
wolter 2024-08-21 15:26:53 +08:00
parent 89b37a73c4
commit 9dac2644d4
1 changed files with 4 additions and 2 deletions

View File

@ -17,10 +17,12 @@ func MerchantList(req backend.MerchantListRequest) (result []merchantmodel.Merch
// 拼接查询条件
conn := builder.NewCond()
if req.Name != "" {
conn = conn.And(builder.Like{"name", req.Name})
temp := strings.ToUpper(req.Name)
conn = conn.And(builder.Like{"upper(name)", temp})
}
if req.Contact != "" {
conn = conn.And(builder.Like{"contact", req.Contact})
temp := strings.ToUpper(req.Contact)
conn = conn.And(builder.Like{"upper(contact)", temp})
}
if req.Phone != "" {
conn = conn.And(builder.Like{"phone", req.Phone})