From 685a7d23b2764243158c3ee6ef07ca5c73b88f53 Mon Sep 17 00:00:00 2001 From: spark Date: Fri, 3 Jan 2025 13:17:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(stock=5Fdata=5Fapi):=20=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E8=82=A1=E7=A5=A8=E6=97=B6=E5=8C=85=E5=90=AB=E6=B7=B1=E4=BA=A4?= =?UTF-8?q?=E6=89=80=E6=8C=87=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将指数市场范围从上交所(SSE)扩展到包括深交所(SZSE) - 优化了股票和指数的搜索逻辑,提高搜索结果的全面性 --- backend/data/stock_data_api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/data/stock_data_api.go b/backend/data/stock_data_api.go index 78f937a..8fecf1d 100644 --- a/backend/data/stock_data_api.go +++ b/backend/data/stock_data_api.go @@ -319,7 +319,7 @@ func (receiver StockDataApi) GetStockList(key string) []StockBasic { var result []StockBasic db.Dao.Model(&StockBasic{}).Where("name like ? or ts_code like ?", "%"+key+"%", "%"+key+"%").Find(&result) var result2 []IndexBasic - db.Dao.Model(&IndexBasic{}).Where("market = ?", "SSE").Where("name like ? or ts_code like ?", "%"+key+"%", "%"+key+"%").Find(&result2) + db.Dao.Model(&IndexBasic{}).Where("market in ?", []string{"SSE", "SZSE"}).Where("name like ? or ts_code like ?", "%"+key+"%", "%"+key+"%").Find(&result2) for _, item := range result2 { result = append(result, StockBasic{