瀏覽代碼

🐛 fix(stock): 修复股票数据更新时间字段名错误

- 将查询条件中的updatedAt修正为updated_at,匹配数据库字段名
- 更新批量插入时的更新字段列表,将updatedAt改为updated_at
yourname 5 月之前
父節點
當前提交
67191c2f1d
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/server/modules/stock/stock-data.service.ts

+ 2 - 2
src/server/modules/stock/stock-data.service.ts

@@ -27,7 +27,7 @@ export class StockDataService extends GenericCrudService<StockData> {
       const existingData = await this.repository
         .createQueryBuilder('stock')
         .where('stock.code = :code', { code })
-        .andWhere('stock.updatedAt >= :today', { today: `${today} 00:00:00` })
+        .andWhere('stock.updated_at >= :today', { today: `${today} 00:00:00` })
         .getOne();
 
       if (existingData) {
@@ -68,7 +68,7 @@ export class StockDataService extends GenericCrudService<StockData> {
         .insert()
         .values(stockData)
         .orUpdate(
-          ['data', 'updatedAt'],
+          ['data', 'updated_at'],
           ['code']
         )
         .execute();