[游戏管理]压注订单

This commit is contained in:
2026-04-15 17:46:18 +08:00
parent 6bca594769
commit 92545067d2
7 changed files with 113 additions and 64 deletions

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace app\admin\controller\game; namespace app\admin\controller\order;
use app\common\controller\Backend; use app\common\controller\Backend;
use support\think\Db; use support\think\Db;
@@ -22,11 +22,11 @@ class BetOrder extends Backend
protected string|array $orderGuarantee = ['id' => 'desc']; protected string|array $orderGuarantee = ['id' => 'desc'];
protected array $withJoinTable = ['gameUser', 'channel', 'gamePeriod']; protected array $withJoinTable = ['user', 'channel', 'gamePeriod'];
protected function initController(WebmanRequest $request): ?Response protected function initController(WebmanRequest $request): ?Response
{ {
$this->model = new \app\common\model\GameBetOrder(); $this->model = new \app\common\model\BetOrder();
return null; return null;
} }
@@ -87,7 +87,7 @@ class BetOrder extends Backend
->withJoin($this->withJoinTable, $this->withJoinType) ->withJoin($this->withJoinTable, $this->withJoinType)
->with($this->withJoinTable) ->with($this->withJoinTable)
->visible([ ->visible([
'gameUser' => ['username', 'phone'], 'user' => ['username', 'phone'],
'channel' => ['name'], 'channel' => ['name'],
'gamePeriod' => ['period_no', 'status'], 'gamePeriod' => ['period_no', 'status'],
]) ])

View File

@@ -4,9 +4,9 @@ namespace app\common\model;
use support\think\Model; use support\think\Model;
class GameBetOrder extends Model class BetOrder extends Model
{ {
protected $name = 'game_bet_order'; protected $name = 'bet_order';
protected $autoWriteTimestamp = true; protected $autoWriteTimestamp = true;
@@ -24,9 +24,9 @@ class GameBetOrder extends Model
'is_auto' => 'integer', 'is_auto' => 'integer',
]; ];
public function gameUser(): \think\model\relation\BelongsTo public function user(): \think\model\relation\BelongsTo
{ {
return $this->belongsTo(GameUser::class, 'user_id', 'id'); return $this->belongsTo(User::class, 'user_id', 'id');
} }
public function channel(): \think\model\relation\BelongsTo public function channel(): \think\model\relation\BelongsTo
@@ -39,3 +39,4 @@ class GameBetOrder extends Model
return $this->belongsTo(GamePeriod::class, 'period_id', 'id'); return $this->belongsTo(GamePeriod::class, 'period_id', 'id');
} }
} }

View File

@@ -22,14 +22,8 @@ export default {
idempotency_key: 'Idempotency key', idempotency_key: 'Idempotency key',
create_time: 'Created', create_time: 'Created',
update_time: 'Updated', update_time: 'Updated',
gamePeriod: { gamePeriod_period_no: 'Period (relation)',
period_no: 'Period (relation)', gamePeriod_status: 'Period status',
status: 'Period status', user_username: 'Username',
}, channel_name: 'Channel',
gameUser: {
username: 'Username',
},
channel: {
name: 'Channel',
},
} }

View File

@@ -0,0 +1,29 @@
export default {
'quick Search Fields': 'ID / Period / Idempotency',
id: 'ID',
period_id: 'Period ID',
period_no: 'Period No.',
user_id: 'User ID',
channel_id: 'Channel ID',
pick_numbers: 'Picks',
unit_amount: 'Unit amount',
pick_count: 'Pick count',
total_amount: 'Total',
streak_at_bet: 'Streak at bet',
is_auto: 'Auto',
'is_auto 0': 'Manual',
'is_auto 1': 'Auto bet',
win_amount: 'Payout',
jackpot_extra_amount: 'Jackpot extra',
status: 'Status',
'status 1': 'Pending draw',
'status 2': 'Settled',
'status 3': 'Refunded',
idempotency_key: 'Idempotency key',
create_time: 'Created',
update_time: 'Updated',
gamePeriod_period_no: 'Period (relation)',
gamePeriod_status: 'Period status',
user_username: 'Username',
channel_name: 'Channel',
}

View File

@@ -22,15 +22,8 @@ export default {
idempotency_key: '幂等键', idempotency_key: '幂等键',
create_time: '创建时间', create_time: '创建时间',
update_time: '更新时间', update_time: '更新时间',
/** 关联展示列(须嵌套,供 t('game.betOrder.gamePeriod.xxx') */ gamePeriod_period_no: '对局期号',
gamePeriod: { gamePeriod_status: '期状态',
period_no: '对局期号', user_username: '用户名',
status: '期状态', channel_name: '渠道',
},
gameUser: {
username: '用户名',
},
channel: {
name: '渠道',
},
} }

View File

@@ -0,0 +1,29 @@
export default {
'quick Search Fields': 'ID/期号/幂等键',
id: 'ID',
period_id: '期ID',
period_no: '期号',
user_id: '用户ID',
channel_id: '渠道ID',
pick_numbers: '选号',
unit_amount: '单号金额',
pick_count: '选号个数',
total_amount: '总金额',
streak_at_bet: '下注时连胜',
is_auto: '托管',
'is_auto 0': '手动',
'is_auto 1': '托管',
win_amount: '派彩',
jackpot_extra_amount: 'Jackpot',
status: '状态',
'status 1': '待开奖',
'status 2': '已结算',
'status 3': '已退款',
idempotency_key: '幂等键',
create_time: '创建时间',
update_time: '更新时间',
gamePeriod_period_no: '对局期号',
gamePeriod_status: '期状态',
user_username: '用户名',
channel_name: '渠道',
}

View File

@@ -4,7 +4,7 @@
<TableHeader <TableHeader
:buttons="['refresh', 'comSearch', 'quickSearch', 'columnDisplay']" :buttons="['refresh', 'comSearch', 'quickSearch', 'columnDisplay']"
:quick-search-placeholder="t('Quick search placeholder', { fields: t('game.betOrder.quick Search Fields') })" :quick-search-placeholder="t('Quick search placeholder', { fields: t('order.betOrder.quick Search Fields') })"
></TableHeader> ></TableHeader>
<Table ref="tableRef"></Table> <Table ref="tableRef"></Table>
@@ -20,7 +20,7 @@ import Table from '/@/components/table/index.vue'
import baTableClass from '/@/utils/baTable' import baTableClass from '/@/utils/baTable'
defineOptions({ defineOptions({
name: 'game/betOrder', name: 'order/betOrder',
}) })
const { t } = useI18n() const { t } = useI18n()
@@ -53,14 +53,14 @@ function formatAmount(_row: anyObj, _column: any, cellValue: unknown) {
} }
const baTable = new baTableClass( const baTable = new baTableClass(
new baTableApi('/admin/game.BetOrder/'), new baTableApi('/admin/order.BetOrder/'),
{ {
pk: 'id', pk: 'id',
column: [ column: [
{ label: t('game.betOrder.id'), prop: 'id', align: 'center', width: 100, operator: 'RANGE', sortable: 'custom' }, { label: t('order.betOrder.id'), prop: 'id', align: 'center', width: 100, operator: 'RANGE', sortable: 'custom' },
{ label: t('game.betOrder.period_id'), prop: 'period_id', align: 'center', width: 100, operator: 'RANGE' }, { label: t('order.betOrder.period_id'), prop: 'period_id', align: 'center', width: 100, operator: 'RANGE' },
{ {
label: t('game.betOrder.period_no'), label: t('order.betOrder.period_no'),
prop: 'period_no', prop: 'period_no',
align: 'center', align: 'center',
minWidth: 160, minWidth: 160,
@@ -68,7 +68,7 @@ const baTable = new baTableClass(
operator: 'LIKE', operator: 'LIKE',
}, },
{ {
label: t('game.betOrder.gamePeriod.period_no'), label: t('order.betOrder.gamePeriod_period_no'),
prop: 'gamePeriod.period_no', prop: 'gamePeriod.period_no',
align: 'center', align: 'center',
minWidth: 160, minWidth: 160,
@@ -77,25 +77,25 @@ const baTable = new baTableClass(
render: 'tags', render: 'tags',
}, },
{ {
label: t('game.betOrder.gamePeriod.status'), label: t('order.betOrder.gamePeriod_status'),
prop: 'gamePeriod.status', prop: 'gamePeriod.status',
align: 'center', align: 'center',
width: 100, width: 100,
operator: 'eq', operator: 'eq',
render: 'tag', render: 'tag',
replaceValue: { replaceValue: {
'0': t('game.period.status 0'), '0': '下注开放',
'1': t('game.period.status 1'), '1': '已封盘',
'2': t('game.period.status 2'), '2': '算票中',
'3': t('game.period.status 3'), '3': '派彩中',
'4': t('game.period.status 4'), '4': '已结束',
'5': t('game.period.status 5'), '5': '已作废',
}, },
}, },
{ label: t('game.betOrder.user_id'), prop: 'user_id', align: 'center', width: 90, operator: 'RANGE' }, { label: t('order.betOrder.user_id'), prop: 'user_id', align: 'center', width: 90, operator: 'RANGE' },
{ {
label: t('game.betOrder.gameUser.username'), label: t('order.betOrder.user_username'),
prop: 'gameUser.username', prop: 'user.username',
align: 'center', align: 'center',
minWidth: 100, minWidth: 100,
operatorPlaceholder: t('Fuzzy query'), operatorPlaceholder: t('Fuzzy query'),
@@ -103,7 +103,7 @@ const baTable = new baTableClass(
render: 'tags', render: 'tags',
}, },
{ {
label: t('game.betOrder.channel.name'), label: t('order.betOrder.channel_name'),
prop: 'channel.name', prop: 'channel.name',
align: 'center', align: 'center',
minWidth: 100, minWidth: 100,
@@ -112,7 +112,7 @@ const baTable = new baTableClass(
render: 'tags', render: 'tags',
}, },
{ {
label: t('game.betOrder.pick_numbers'), label: t('order.betOrder.pick_numbers'),
prop: 'pick_numbers', prop: 'pick_numbers',
align: 'center', align: 'center',
minWidth: 120, minWidth: 120,
@@ -120,37 +120,37 @@ const baTable = new baTableClass(
formatter: formatPickNumbers, formatter: formatPickNumbers,
}, },
{ {
label: t('game.betOrder.unit_amount'), label: t('order.betOrder.unit_amount'),
prop: 'unit_amount', prop: 'unit_amount',
align: 'center', align: 'center',
minWidth: 110, minWidth: 110,
operator: 'RANGE', operator: 'RANGE',
formatter: formatAmount, formatter: formatAmount,
}, },
{ label: t('game.betOrder.pick_count'), prop: 'pick_count', align: 'center', width: 90, operator: 'RANGE' }, { label: t('order.betOrder.pick_count'), prop: 'pick_count', align: 'center', width: 90, operator: 'RANGE' },
{ {
label: t('game.betOrder.total_amount'), label: t('order.betOrder.total_amount'),
prop: 'total_amount', prop: 'total_amount',
align: 'center', align: 'center',
minWidth: 110, minWidth: 110,
operator: 'RANGE', operator: 'RANGE',
formatter: formatAmount, formatter: formatAmount,
}, },
{ label: t('game.betOrder.streak_at_bet'), prop: 'streak_at_bet', align: 'center', width: 110, operator: 'RANGE' }, { label: t('order.betOrder.streak_at_bet'), prop: 'streak_at_bet', align: 'center', width: 110, operator: 'RANGE' },
{ {
label: t('game.betOrder.is_auto'), label: t('order.betOrder.is_auto'),
prop: 'is_auto', prop: 'is_auto',
align: 'center', align: 'center',
width: 90, width: 90,
operator: 'eq', operator: 'eq',
render: 'tag', render: 'tag',
replaceValue: { replaceValue: {
'0': t('game.betOrder.is_auto 0'), '0': t('order.betOrder.is_auto 0'),
'1': t('game.betOrder.is_auto 1'), '1': t('order.betOrder.is_auto 1'),
}, },
}, },
{ {
label: t('game.betOrder.win_amount'), label: t('order.betOrder.win_amount'),
prop: 'win_amount', prop: 'win_amount',
align: 'center', align: 'center',
minWidth: 110, minWidth: 110,
@@ -158,7 +158,7 @@ const baTable = new baTableClass(
formatter: formatAmount, formatter: formatAmount,
}, },
{ {
label: t('game.betOrder.jackpot_extra_amount'), label: t('order.betOrder.jackpot_extra_amount'),
prop: 'jackpot_extra_amount', prop: 'jackpot_extra_amount',
align: 'center', align: 'center',
minWidth: 120, minWidth: 120,
@@ -166,20 +166,20 @@ const baTable = new baTableClass(
formatter: formatAmount, formatter: formatAmount,
}, },
{ {
label: t('game.betOrder.status'), label: t('order.betOrder.status'),
prop: 'status', prop: 'status',
align: 'center', align: 'center',
width: 100, width: 100,
operator: 'eq', operator: 'eq',
render: 'tag', render: 'tag',
replaceValue: { replaceValue: {
'1': t('game.betOrder.status 1'), '1': t('order.betOrder.status 1'),
'2': t('game.betOrder.status 2'), '2': t('order.betOrder.status 2'),
'3': t('game.betOrder.status 3'), '3': t('order.betOrder.status 3'),
}, },
}, },
{ {
label: t('game.betOrder.idempotency_key'), label: t('order.betOrder.idempotency_key'),
prop: 'idempotency_key', prop: 'idempotency_key',
align: 'center', align: 'center',
minWidth: 140, minWidth: 140,
@@ -188,7 +188,7 @@ const baTable = new baTableClass(
showOverflowTooltip: true, showOverflowTooltip: true,
}, },
{ {
label: t('game.betOrder.create_time'), label: t('order.betOrder.create_time'),
prop: 'create_time', prop: 'create_time',
align: 'center', align: 'center',
render: 'datetime', render: 'datetime',
@@ -199,7 +199,7 @@ const baTable = new baTableClass(
timeFormat: 'yyyy-mm-dd hh:MM:ss', timeFormat: 'yyyy-mm-dd hh:MM:ss',
}, },
{ {
label: t('game.betOrder.update_time'), label: t('order.betOrder.update_time'),
prop: 'update_time', prop: 'update_time',
align: 'center', align: 'center',
render: 'datetime', render: 'datetime',
@@ -228,3 +228,6 @@ onMounted(() => {
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss"></style>