|
|
@@ -744,10 +744,11 @@ namespace molilian.api.Controllers
|
|
|
var result = new List<dynamic>();
|
|
|
var reason_result = new List<dynamic>();
|
|
|
|
|
|
- var report_date = form.PathReadArray<string>("query_date[]");
|
|
|
- var accountName = form.Read("accountName", string.Empty);
|
|
|
- var isHourtrend = form.Read<bool>("isLeaf", false);
|
|
|
- var total_key = form.Read("total_key", "total");
|
|
|
+ var report_date = form.PathReadArray<string>("query_date[]");
|
|
|
+ var accountName = form.Read("accountName", string.Empty);
|
|
|
+ var accountId = form.Read("accountId", 0);
|
|
|
+ var isHourtrend = form.Read<bool>("isLeaf", false);
|
|
|
+ var total_key = form.Read("total_key", "total");
|
|
|
|
|
|
DateTime stime = DateTime.MinValue;
|
|
|
if (!DateTime.TryParse(report_date[0], out stime)) return new APIResult(new { data = result, data2 = reason_result });
|
|
|
@@ -802,12 +803,35 @@ namespace molilian.api.Controllers
|
|
|
}
|
|
|
return new APIResult(new { total, data = result, data2 = reason_result });
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- string cacheKey = $":{total_key}:{accountName}:{_report_date}";
|
|
|
- double total = await TkLogCore.GetTotalAsync(cacheKey, false);
|
|
|
- if (total > 0)
|
|
|
- {
|
|
|
+ else
|
|
|
+ {
|
|
|
+ // The report row is identified by tk_pool.id. This is independent of the
|
|
|
+ // riskStrategy/launchScene label (for example tbpush-220), which can be shared
|
|
|
+ // by multiple accounts.
|
|
|
+ string requestedAccountName = accountName;
|
|
|
+ if (accountId > 0)
|
|
|
+ {
|
|
|
+ accountName = $"{TkChannelEnum.tb}_{accountId}";
|
|
|
+ }
|
|
|
+
|
|
|
+ string cacheKey = $":{total_key}:{accountName}:{_report_date}";
|
|
|
+ double total = await TkLogCore.GetTotalAsync(cacheKey, false);
|
|
|
+ if (total == 0 &&
|
|
|
+ accountId > 0 &&
|
|
|
+ !string.IsNullOrEmpty(requestedAccountName) &&
|
|
|
+ !string.Equals(requestedAccountName, "all", StringComparison.OrdinalIgnoreCase) &&
|
|
|
+ !string.Equals(requestedAccountName, TkChannelEnum.tb.ToString(), StringComparison.OrdinalIgnoreCase) &&
|
|
|
+ !string.Equals(requestedAccountName, accountName, StringComparison.Ordinal))
|
|
|
+ {
|
|
|
+ cacheKey = $":{total_key}:{requestedAccountName}:{_report_date}";
|
|
|
+ total = await TkLogCore.GetTotalAsync(cacheKey, false);
|
|
|
+ if (total > 0)
|
|
|
+ {
|
|
|
+ accountName = requestedAccountName;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (total > 0)
|
|
|
+ {
|
|
|
string[] keys = ["success"];
|
|
|
|
|
|
cacheKey = $":{total_key}:{accountName}:message:{_report_date}";
|