1.抽奖测试记录页面/dice/play_record_test/index增加彩金池配置筛选条件
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
"platformTotalProfit": "Platform Total Profit"
|
"platformTotalProfit": "Platform Total Profit"
|
||||||
},
|
},
|
||||||
"search": {
|
"search": {
|
||||||
|
"lotteryPoolConfig": "Lottery Pool Config",
|
||||||
|
"placeholderLotteryPool": "Select pool (search by name)",
|
||||||
"rewardConfigRecordId": "Weight Test Record ID",
|
"rewardConfigRecordId": "Weight Test Record ID",
|
||||||
"drawType": "Draw Type",
|
"drawType": "Draw Type",
|
||||||
"direction": "Direction",
|
"direction": "Direction",
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
"platformTotalProfit": "平台总盈利"
|
"platformTotalProfit": "平台总盈利"
|
||||||
},
|
},
|
||||||
"search": {
|
"search": {
|
||||||
|
"lotteryPoolConfig": "彩金池配置",
|
||||||
|
"placeholderLotteryPool": "请选择彩金池(可搜索 name)",
|
||||||
"rewardConfigRecordId": "测试记录ID",
|
"rewardConfigRecordId": "测试记录ID",
|
||||||
"drawType": "抽奖类型",
|
"drawType": "抽奖类型",
|
||||||
"direction": "方向",
|
"direction": "方向",
|
||||||
|
|||||||
@@ -159,6 +159,7 @@
|
|||||||
|
|
||||||
// 搜索表单(与 play_record 对齐:方向、赢取平台币范围、是否中大奖、中奖档位、点数和)
|
// 搜索表单(与 play_record 对齐:方向、赢取平台币范围、是否中大奖、中奖档位、点数和)
|
||||||
const searchForm = ref<Record<string, unknown>>({
|
const searchForm = ref<Record<string, unknown>>({
|
||||||
|
lottery_config_id: undefined,
|
||||||
reward_config_record_id: undefined,
|
reward_config_record_id: undefined,
|
||||||
lottery_type: undefined,
|
lottery_type: undefined,
|
||||||
direction: undefined,
|
direction: undefined,
|
||||||
|
|||||||
@@ -8,6 +8,29 @@
|
|||||||
@search="handleSearch"
|
@search="handleSearch"
|
||||||
@expand="handleExpand"
|
@expand="handleExpand"
|
||||||
>
|
>
|
||||||
|
<el-col v-bind="setSpan(6)">
|
||||||
|
<el-form-item :label="$t('page.search.lotteryPoolConfig')" prop="lottery_config_id">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.lottery_config_id"
|
||||||
|
:placeholder="$t('page.search.placeholderLotteryPool')"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
reserve-keyword
|
||||||
|
:loading="lotteryPoolLoading"
|
||||||
|
:remote-method="filterLotteryPoolOptions"
|
||||||
|
style="width: 100%"
|
||||||
|
@visible-change="onLotteryPoolDropdownVisible"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in lotteryPoolOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="lotteryPoolOptionLabel(item)"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col v-bind="setSpan(6)">
|
<el-col v-bind="setSpan(6)">
|
||||||
<el-form-item :label="$t('page.search.rewardConfigRecordId')" prop="reward_config_record_id">
|
<el-form-item :label="$t('page.search.rewardConfigRecordId')" prop="reward_config_record_id">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
@@ -120,6 +143,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import lotteryPoolApi from '../../../api/lottery_pool_config/index'
|
||||||
|
import {
|
||||||
|
getChannelDeptRequestParams,
|
||||||
|
useInjectedChannelDept
|
||||||
|
} from '@/composables/useChannelDeptScope'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
modelValue: Record<string, any>
|
modelValue: Record<string, any>
|
||||||
}
|
}
|
||||||
@@ -131,6 +160,70 @@
|
|||||||
const props = defineProps<Props>()
|
const props = defineProps<Props>()
|
||||||
const emit = defineEmits<Emits>()
|
const emit = defineEmits<Emits>()
|
||||||
const isExpanded = ref<boolean>(false)
|
const isExpanded = ref<boolean>(false)
|
||||||
|
const channelScope = useInjectedChannelDept()
|
||||||
|
|
||||||
|
const lotteryPoolAllOptions = ref<Array<{ id: number; name: string }>>([])
|
||||||
|
const lotteryPoolOptions = ref<Array<{ id: number; name: string }>>([])
|
||||||
|
const lotteryPoolLoading = ref(false)
|
||||||
|
|
||||||
|
function resolveDeptParams(): Record<string, unknown> {
|
||||||
|
const extra = getChannelDeptRequestParams()
|
||||||
|
if (extra.dept_id !== undefined) {
|
||||||
|
return extra
|
||||||
|
}
|
||||||
|
if (channelScope) {
|
||||||
|
return { dept_id: channelScope.selectedDeptId.value }
|
||||||
|
}
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
|
||||||
|
function lotteryPoolOptionLabel(item: { id: number; name: string }): string {
|
||||||
|
const name = (item.name || '').trim()
|
||||||
|
return name ? `${name} (#${item.id})` : `#${item.id}`
|
||||||
|
}
|
||||||
|
|
||||||
|
async function loadLotteryPoolOptions() {
|
||||||
|
lotteryPoolLoading.value = true
|
||||||
|
try {
|
||||||
|
const list = await lotteryPoolApi.getOptions(resolveDeptParams())
|
||||||
|
lotteryPoolAllOptions.value = list
|
||||||
|
lotteryPoolOptions.value = list
|
||||||
|
} catch {
|
||||||
|
lotteryPoolAllOptions.value = []
|
||||||
|
lotteryPoolOptions.value = []
|
||||||
|
} finally {
|
||||||
|
lotteryPoolLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function filterLotteryPoolOptions(query: string) {
|
||||||
|
const q = (query || '').trim().toLowerCase()
|
||||||
|
if (!q) {
|
||||||
|
lotteryPoolOptions.value = [...lotteryPoolAllOptions.value]
|
||||||
|
return
|
||||||
|
}
|
||||||
|
lotteryPoolOptions.value = lotteryPoolAllOptions.value.filter((item) => {
|
||||||
|
const name = (item.name || '').toLowerCase()
|
||||||
|
return name.includes(q) || String(item.id).includes(q)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function onLotteryPoolDropdownVisible(visible: boolean) {
|
||||||
|
if (visible && lotteryPoolAllOptions.value.length === 0) {
|
||||||
|
void loadLotteryPoolOptions()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
void loadLotteryPoolOptions()
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => channelScope?.selectedDeptId.value,
|
||||||
|
() => {
|
||||||
|
void loadLotteryPoolOptions()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
const searchBarRef = ref()
|
const searchBarRef = ref()
|
||||||
const formData = computed({
|
const formData = computed({
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class DicePlayRecordTestController extends BaseController
|
|||||||
{
|
{
|
||||||
$where = $request->more([
|
$where = $request->more([
|
||||||
['reward_config_record_id', ''],
|
['reward_config_record_id', ''],
|
||||||
|
['lottery_config_id', ''],
|
||||||
['lottery_type', ''],
|
['lottery_type', ''],
|
||||||
['direction', ''],
|
['direction', ''],
|
||||||
['is_win', ''],
|
['is_win', ''],
|
||||||
|
|||||||
@@ -73,6 +73,15 @@ class DicePlayRecordTest extends DiceModel
|
|||||||
return $this->belongsTo(DiceRewardConfigRecord::class, 'reward_config_record_id', 'id');
|
return $this->belongsTo(DiceRewardConfigRecord::class, 'reward_config_record_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 彩金池配置 id(关联 dice_lottery_pool_config.id) */
|
||||||
|
public function searchLotteryConfigIdAttr($query, $value): void
|
||||||
|
{
|
||||||
|
if ($value === '' || $value === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$query->where('lottery_config_id', '=', (int) $value);
|
||||||
|
}
|
||||||
|
|
||||||
/** 抽奖类型 0=付费 1=免费 */
|
/** 抽奖类型 0=付费 1=免费 */
|
||||||
public function searchLotteryTypeAttr($query, $value)
|
public function searchLotteryTypeAttr($query, $value)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user