+ {row.original.grant_message || "--"}
+ {row.original.dispatch_error && (
+
+ {row.original.dispatch_error}
+
+ )}
+
+ ),
+ },
+ {
+ accessorKey: "drawn_at",
+ header: t("draw.drawnAt", "Drawn at"),
+ cell: ({ row }) =>
+ row.original.drawn_at ? formatDate(row.original.drawn_at) : "--",
+ },
+ ]}
+ header={{ title: t("draw.tableTitle", "Draw records") }}
+ params={[
+ {
+ key: "win",
+ options: winOptions,
+ placeholder: t("draw.filterWin", "Won?"),
+ },
+ {
+ key: "dispatch_state",
+ options: dispatchOptions,
+ placeholder: t("draw.filterDispatch", "Dispatch"),
+ },
+ {
+ key: "user_id",
+ placeholder: t("draw.filterUserId", "User ID"),
+ },
+ ]}
+ request={async (pagination, filter) => {
+ const { data } = await getLotteryDrawList({
+ page: pagination.page,
+ size: pagination.size,
+ activity_id: activity.id,
+ win: (filter.win as "1" | "0") || undefined,
+ dispatch_state: filter.dispatch_state || undefined,
+ user_id: filter.user_id ? Number(filter.user_id) : undefined,
+ });
+ return {
+ list: data.data?.list || [],
+ total: data.data?.total || 0,
+ };
+ }}
+ />
+ );
+}
diff --git a/packages/ui/src/services/admin/lottery.ts b/packages/ui/src/services/admin/lottery.ts
index 436f301..215ec5b 100644
--- a/packages/ui/src/services/admin/lottery.ts
+++ b/packages/ui/src/services/admin/lottery.ts
@@ -373,3 +373,21 @@ export async function markPaidLotteryClaim(
}
);
}
+
+/**
+ * 抽奖记录(发放流水)
+ * GET /v1/admin/lottery/draws
+ */
+export async function getLotteryDrawList(
+ params: API.GetLotteryDrawListParams,
+ options?: { [key: string]: any }
+) {
+ return request