fix: 产品搜索关键词高亮

This commit is contained in:
2025-07-01 17:13:24 +08:00
parent 439d001ff0
commit db3040c0b0
3 changed files with 23 additions and 4 deletions

View File

@@ -79,6 +79,6 @@ class ProductModel extends ProductBaseModel
// 关键词搜索
public function searchKeywordsAttr($query, string $keywords)
{
$query->whereRaw('BINARY spu LIKE "%' . $keywords . '%" OR BINARY name LIKE "%' . $keywords . '%" OR BINARY short_name LIKE "%' . $keywords . '%"');
$query->whereRaw('spu LIKE "%' . $keywords . '%" OR name LIKE "%' . $keywords . '%" OR short_name LIKE "%' . $keywords . '%"');
}
}