mall数据库文件

This commit is contained in:
comlibmb
2026-01-30 16:11:23 +08:00
parent b53d2376ff
commit cfec4a16c0
71 changed files with 11786 additions and 1009 deletions

View File

@@ -0,0 +1,41 @@
import { computeDateRange } from './dateRange.uts'
import { rpcOrEmptyArray, rpcOrNull } from './rpc.uts'
export type CouponAnalysisData = {
overviewRow: UTSJSONObject | null
typeList: Array<UTSJSONObject>
channelList: Array<UTSJSONObject>
trendList: Array<UTSJSONObject>
conversionList: Array<UTSJSONObject>
}
export async function fetchCouponAnalysis(period: string): Promise<CouponAnalysisData> {
const { startIso, endIso } = computeDateRange(period)
const overviewRow = await rpcOrNull('rpc_coupon_effectiveness_overview', {
p_start: startIso,
p_end: endIso
} as UTSJSONObject)
const typeList = await rpcOrEmptyArray('rpc_coupon_type_stats', {
p_start: startIso,
p_end: endIso
} as UTSJSONObject)
const channelList = await rpcOrEmptyArray('rpc_coupon_channel_stats', {
p_start: startIso,
p_end: endIso
} as UTSJSONObject)
const trendList = await rpcOrEmptyArray('rpc_coupon_trend_daily', {
p_start: startIso,
p_end: endIso
} as UTSJSONObject)
const conversionList = await rpcOrEmptyArray('rpc_coupon_conversion_effect', {
p_start: startIso,
p_end: endIso
} as UTSJSONObject)
return { overviewRow, typeList, channelList, trendList, conversionList }
}