Merge pull request #246 from fasiondog/feature/strategey

fixed strategy 加载权息失败
This commit is contained in:
fasiondog 2024-05-07 01:49:55 +08:00 committed by GitHub
commit c7150847bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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 {