fixed strategy 加载权息失败

This commit is contained in:
fasiondog 2024-05-07 00:40:36 +08:00
parent f3bfb8b08a
commit 53ee558b6e
2 changed files with 4 additions and 4 deletions

View File

@ -106,14 +106,14 @@ StockWeightList MySQLBaseInfoDriver::getStockWeightList(const string &market, co
HKU_CHECK(con, "Failed fetch connect!");
vector<StockWeightTable> table;
Datetime new_start = start.isNull() ? Datetime::min() : start;
Datetime new_end = end.isNull() ? Datetime::max() : end;
con->batchLoad(
table,
format(
"stockid=(select stockid from stock where marketid=(select marketid from "
"market where market='{}') and code='{}') and date>={} and date<{} order by date asc",
market, code, start.year() * 10000 + start.month() * 100 + start.day(),
new_end.year() * 10000 + new_end.month() * 100 + new_end.day()));
market, code, new_start.ymd(), new_end.ymd()));
for (auto &w : table) {
try {

View File

@ -127,14 +127,14 @@ StockWeightList SQLiteBaseInfoDriver::getStockWeightList(const string& market, c
HKU_CHECK(con, "Failed fetch connect!");
vector<StockWeightTable> table;
Datetime new_start = start.isNull() ? Datetime::min() : start;
Datetime new_end = end.isNull() ? Datetime::max() : end;
con->batchLoad(
table,
format(
"stockid=(select stockid from stock where marketid=(select marketid from "
"market where market='{}') and code='{}') and date>={} and date<{} order by date asc",
market, code, start.year() * 10000 + start.month() * 100 + start.day(),
new_end.year() * 10000 + new_end.month() * 100 + new_end.day()));
market, code, new_start.ymd(), new_end.ymd()));
for (auto& w : table) {
try {