Browse Source

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

- 将查询条件中的updatedAt修正为updated_at,匹配数据库字段名
- 更新批量插入时的更新字段列表,将updatedAt改为updated_at
yourname 5 tháng trước cách đây
mục cha
commit
67191c2f1d
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  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();