feat(backend): 出入库编码搜索双路匹配+建单填快照;finance 趋势/日期区间;partner/product 拼音搜索
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
This commit is contained in:
@@ -39,8 +39,11 @@ func (h *ProductHandler) List(c *gin.Context) {
|
||||
Where("shop_id = ? AND deleted_at IS NULL", shopID)
|
||||
|
||||
if keyword != "" {
|
||||
query = query.Where("name LIKE ? OR code LIKE ? OR barcode LIKE ?",
|
||||
"%"+keyword+"%", "%"+keyword+"%", "%"+keyword+"%")
|
||||
// 原型搜索口径:商品名 / 拼音(全拼+首字母)/ 编码;barcode 保留兼容
|
||||
like := "%" + keyword + "%"
|
||||
query = query.Where(
|
||||
"name LIKE ? OR code LIKE ? OR barcode LIKE ? OR name_pinyin LIKE ? OR name_initials LIKE ?",
|
||||
like, like, like, like, like)
|
||||
}
|
||||
if categoryID != "" {
|
||||
query = query.Where("category_id = ?", categoryID)
|
||||
|
||||
Reference in New Issue
Block a user