[积分商城]PlayX领取记录
This commit is contained in:
57
app/admin/controller/mall/PlayxClaimLog.php
Normal file
57
app/admin/controller/mall/PlayxClaimLog.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller\mall;
|
||||
|
||||
use Throwable;
|
||||
use app\common\controller\Backend;
|
||||
use support\Response;
|
||||
use Webman\Http\Request;
|
||||
|
||||
/**
|
||||
* PlayX 领取记录(后台列表)
|
||||
*/
|
||||
class PlayxClaimLog extends Backend
|
||||
{
|
||||
/**
|
||||
* @var object|null
|
||||
* @phpstan-var \app\common\model\MallPlayxClaimLog|null
|
||||
*/
|
||||
protected ?object $model = null;
|
||||
|
||||
protected array|string $preExcludeFields = ['id', 'create_time', 'update_time'];
|
||||
|
||||
protected string|array $quickSearchField = ['user_id', 'claim_request_id'];
|
||||
|
||||
protected string|array $indexField = [
|
||||
'id',
|
||||
'claim_request_id',
|
||||
'user_id',
|
||||
'claimed_amount',
|
||||
'create_time',
|
||||
];
|
||||
|
||||
public function initialize(): void
|
||||
{
|
||||
parent::initialize();
|
||||
$this->model = new \app\common\model\MallPlayxClaimLog();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function index(Request $request): Response
|
||||
{
|
||||
$response = $this->initializeBackend($request);
|
||||
if ($response !== null) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
if ($request->get('select') || $request->post('select')) {
|
||||
return $this->select($request);
|
||||
}
|
||||
|
||||
return $this->_index();
|
||||
}
|
||||
}
|
||||
|
||||
20
app/common/model/MallPlayxClaimLog.php
Normal file
20
app/common/model/MallPlayxClaimLog.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use support\think\Model;
|
||||
|
||||
/**
|
||||
* PlayX 领取记录(幂等)
|
||||
*/
|
||||
class MallPlayxClaimLog extends Model
|
||||
{
|
||||
protected string $name = 'mall_playx_claim_log';
|
||||
|
||||
protected array $type = [
|
||||
'claimed_amount' => 'integer',
|
||||
'create_time' => 'integer',
|
||||
];
|
||||
}
|
||||
8
web/src/lang/backend/en/mall/playxClaimLog.ts
Normal file
8
web/src/lang/backend/en/mall/playxClaimLog.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export default {
|
||||
id: 'id',
|
||||
claim_request_id: 'claim_request_id',
|
||||
user_id: 'user_id',
|
||||
claimed_amount: 'claimed_amount',
|
||||
create_time: 'create_time',
|
||||
'quick Search Fields': 'id',
|
||||
}
|
||||
9
web/src/lang/backend/zh-cn/mall/playxClaimLog.ts
Normal file
9
web/src/lang/backend/zh-cn/mall/playxClaimLog.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export default {
|
||||
id: 'ID',
|
||||
claim_request_id: '领取幂等键',
|
||||
user_id: '用户ID',
|
||||
claimed_amount: '领取积分',
|
||||
create_time: '创建时间',
|
||||
'quick Search Fields': 'ID',
|
||||
}
|
||||
|
||||
61
web/src/views/backend/mall/playxClaimLog/index.vue
Normal file
61
web/src/views/backend/mall/playxClaimLog/index.vue
Normal file
@@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<div class="default-main ba-table-box">
|
||||
<el-alert class="ba-table-alert" v-if="baTable.table.remark" :title="baTable.table.remark" type="info" show-icon />
|
||||
|
||||
<TableHeader
|
||||
:buttons="['refresh', 'comSearch', 'quickSearch', 'columnDisplay']"
|
||||
:quick-search-placeholder="t('Quick search placeholder', { fields: t('mall.playxClaimLog.quick Search Fields') })"
|
||||
></TableHeader>
|
||||
|
||||
<Table ref="tableRef"></Table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, provide, useTemplateRef } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { baTableApi } from '/@/api/common'
|
||||
import TableHeader from '/@/components/table/header/index.vue'
|
||||
import Table from '/@/components/table/index.vue'
|
||||
import baTableClass from '/@/utils/baTable'
|
||||
|
||||
defineOptions({
|
||||
name: 'mall/playxClaimLog',
|
||||
})
|
||||
|
||||
const { t } = useI18n()
|
||||
const tableRef = useTemplateRef('tableRef')
|
||||
|
||||
const baTable = new baTableClass(
|
||||
new baTableApi('/admin/mall.PlayxClaimLog/'),
|
||||
{
|
||||
pk: 'id',
|
||||
column: [
|
||||
{ type: 'selection', align: 'center', operator: false },
|
||||
{ label: t('mall.playxClaimLog.id'), prop: 'id', align: 'center', width: 70, operator: 'RANGE', sortable: 'custom' },
|
||||
{ label: t('mall.playxClaimLog.claim_request_id'), prop: 'claim_request_id', align: 'center', operatorPlaceholder: t('Fuzzy query'), sortable: false, operator: 'LIKE' },
|
||||
{ label: t('mall.playxClaimLog.user_id'), prop: 'user_id', align: 'center', operatorPlaceholder: t('Fuzzy query'), sortable: false, operator: 'LIKE' },
|
||||
{ label: t('mall.playxClaimLog.claimed_amount'), prop: 'claimed_amount', align: 'center', operator: 'RANGE', sortable: false },
|
||||
{ label: t('mall.playxClaimLog.create_time'), prop: 'create_time', align: 'center', render: 'datetime', operator: 'RANGE', comSearchRender: 'datetime', sortable: 'custom', width: 160, timeFormat: 'yyyy-mm-dd hh:MM:ss' },
|
||||
],
|
||||
dblClickNotEditColumn: [undefined],
|
||||
},
|
||||
{
|
||||
defaultItems: {},
|
||||
},
|
||||
)
|
||||
|
||||
provide('baTable', baTable)
|
||||
|
||||
onMounted(() => {
|
||||
baTable.table.ref = tableRef.value
|
||||
baTable.mount()
|
||||
baTable.getData()?.then(() => {
|
||||
baTable.initSort()
|
||||
baTable.dragSort()
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
Reference in New Issue
Block a user