优化和平小店兑换记录查询

This commit is contained in:
yml2213
2026-08-09 12:54:37 +08:00
parent 8919d020c5
commit 1cd94c0179
7 changed files with 396 additions and 842 deletions
+20
View File
@@ -279,6 +279,26 @@ func (a *App) QueryXiaodianExchangeRecords(commodityID, commodityName string) ty
return result
}
// QueryXiaodianAccountExchangeRecords 查询一个账号的和平小店真实订单,供账号表按需展开使用。
func (a *App) QueryXiaodianAccountExchangeRecords(accountName string) types.XiaodianExchangeAccountResult {
accountName = strings.TrimSpace(accountName)
if !a.getClient().Activity.IsXiaodian {
return types.XiaodianExchangeAccountResult{Error: "当前活动不是和平小店"}
}
if accountName == "" {
return types.XiaodianExchangeAccountResult{Error: "缺少账号名"}
}
cookie, ok := a.scheduler.AccountCookieByName(accountName)
if !ok || strings.TrimSpace(cookie) == "" {
return types.XiaodianExchangeAccountResult{Error: "账号不存在或 Cookie 为空"}
}
records, err := a.getClient().XiaodianExchangeList(cookie)
if err != nil {
return types.XiaodianExchangeAccountResult{Error: "查询失败: " + err.Error()}
}
return types.XiaodianExchangeAccountResult{Success: true, Records: records}
}
// VerifyAndExport 复验并导出结果。
func (a *App) VerifyAndExport(commodityID string) types.VerifyAndExportResult {
accounts := a.scheduler.AccountSnapshot()