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:
wangjia
2026-07-02 22:27:13 +08:00
parent af56055eef
commit 9099c4af99
21 changed files with 610 additions and 39 deletions
+5 -2
View File
@@ -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)