玩家抽奖记录-新增平台盈利汇总
This commit is contained in:
@@ -36,6 +36,9 @@
|
|||||||
"editSuccess": "Updated successfully",
|
"editSuccess": "Updated successfully",
|
||||||
"validateFailed": "Validation failed, please check required fields and format"
|
"validateFailed": "Validation failed, please check required fields and format"
|
||||||
},
|
},
|
||||||
|
"toolbar": {
|
||||||
|
"platformTotalProfit": "Platform Total Profit"
|
||||||
|
},
|
||||||
"search": {
|
"search": {
|
||||||
"player": "Player",
|
"player": "Player",
|
||||||
"lotteryPoolConfig": "Lottery Pool Config",
|
"lotteryPoolConfig": "Lottery Pool Config",
|
||||||
|
|||||||
@@ -36,6 +36,9 @@
|
|||||||
"editSuccess": "修改成功",
|
"editSuccess": "修改成功",
|
||||||
"validateFailed": "表单验证失败,请检查必填项与格式"
|
"validateFailed": "表单验证失败,请检查必填项与格式"
|
||||||
},
|
},
|
||||||
|
"toolbar": {
|
||||||
|
"platformTotalProfit": "平台总盈利"
|
||||||
|
},
|
||||||
"search": {
|
"search": {
|
||||||
"player": "玩家",
|
"player": "玩家",
|
||||||
"lotteryPoolConfig": "彩金池配置",
|
"lotteryPoolConfig": "彩金池配置",
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
<!-- 表格头部 -->
|
<!-- 表格头部 -->
|
||||||
<ArtTableHeader v-model:columns="columnChecks" :loading="loading" @refresh="refreshData">
|
<ArtTableHeader v-model:columns="columnChecks" :loading="loading" @refresh="refreshData">
|
||||||
<template #left>
|
<template #left>
|
||||||
|
<span v-if="totalWinCoin !== null" class="table-summary-inline">
|
||||||
|
{{ $t('page.toolbar.platformTotalProfit') }}:<strong>{{ totalWinCoin }}</strong>
|
||||||
|
</span>
|
||||||
<!-- <ElSpace wrap>-->
|
<!-- <ElSpace wrap>-->
|
||||||
<!-- <ElButton-->
|
<!-- <ElButton-->
|
||||||
<!-- v-permission="'dice:play_record:index:save'"-->
|
<!-- v-permission="'dice:play_record:index:save'"-->
|
||||||
@@ -126,6 +129,15 @@
|
|||||||
direction: undefined
|
direction: undefined
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/** 当前筛选下平台总盈利(付费抽奖次数×100 - 玩家总收益) */
|
||||||
|
const totalWinCoin = ref<number | null>(null)
|
||||||
|
|
||||||
|
const listApi = async (params: Record<string, any>) => {
|
||||||
|
const res = await api.list(params)
|
||||||
|
totalWinCoin.value = (res as any)?.total_win_coin ?? null
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
// 搜索处理
|
// 搜索处理
|
||||||
const handleSearch = (params: Record<string, any>) => {
|
const handleSearch = (params: Record<string, any>) => {
|
||||||
Object.assign(searchParams, params)
|
Object.assign(searchParams, params)
|
||||||
@@ -170,7 +182,7 @@
|
|||||||
refreshData
|
refreshData
|
||||||
} = useTable({
|
} = useTable({
|
||||||
core: {
|
core: {
|
||||||
apiFn: api.list,
|
apiFn: listApi,
|
||||||
apiParams: { limit: 100 },
|
apiParams: { limit: 100 },
|
||||||
columnsFactory: () => [
|
columnsFactory: () => [
|
||||||
// { type: 'selection' },
|
// { type: 'selection' },
|
||||||
@@ -220,3 +232,15 @@
|
|||||||
// selectedRows
|
// selectedRows
|
||||||
} = useSaiAdmin()
|
} = useSaiAdmin()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.table-summary-inline {
|
||||||
|
margin-right: 12px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: var(--el-text-color-regular);
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.table-summary-inline strong {
|
||||||
|
color: var(--el-color-danger);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -60,7 +60,16 @@ class DicePlayRecordController extends BaseController
|
|||||||
'diceRewardConfig',
|
'diceRewardConfig',
|
||||||
'diceLotteryPoolConfig',
|
'diceLotteryPoolConfig',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// 按当前筛选条件统计:平台总盈利 = 付费抽奖(lottery_type=0)次数×100 - 玩家总收益(win_coin 求和)
|
||||||
|
$sumQuery = clone $query;
|
||||||
|
$playerTotalWin = (float) $sumQuery->sum('win_coin');
|
||||||
|
$paidCountQuery = clone $query;
|
||||||
|
$paidCount = (int) $paidCountQuery->where('lottery_type', 0)->count();
|
||||||
|
$totalWinCoin = $paidCount * 100 - $playerTotalWin;
|
||||||
|
|
||||||
$data = $this->logic->getList($query);
|
$data = $this->logic->getList($query);
|
||||||
|
$data['total_win_coin'] = $totalWinCoin;
|
||||||
return $this->success($data);
|
return $this->success($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user