diff --git a/app/admin/controller/mall/PlayxConfig.php b/app/admin/controller/mall/PlayxConfig.php index 3ac046c..ec2be24 100644 --- a/app/admin/controller/mall/PlayxConfig.php +++ b/app/admin/controller/mall/PlayxConfig.php @@ -52,18 +52,27 @@ class PlayxConfig extends Backend $return = $data['return_ratio'] ?? null; $unlock = $data['unlock_ratio'] ?? null; - $cash = $data['points_to_cash_ratio'] ?? null; - if (!is_numeric($return) || !is_numeric($unlock) || !is_numeric($cash)) { + if (!is_numeric($return) || !is_numeric($unlock)) { return $this->error(__('Parameter error')); } $returnF = floatval($return); $unlockF = floatval($unlock); - $cashF = floatval($cash); - if ($returnF < 0 || $unlockF < 0 || $cashF < 0) { + if ($returnF < 0 || $unlockF < 0) { return $this->error(__('Parameter error')); } + $cashF = null; + if (array_key_exists('points_to_cash_ratio', $data) && $data['points_to_cash_ratio'] !== null && $data['points_to_cash_ratio'] !== '') { + if (!is_numeric($data['points_to_cash_ratio'])) { + return $this->error(__('Parameter error')); + } + $cashF = floatval($data['points_to_cash_ratio']); + if ($cashF < 0) { + return $this->error(__('Parameter error')); + } + } + $dailyEnabled = !empty($data['daily_points_enabled']) ? 1 : 0; $lifetimeEnabled = !empty($data['lifetime_points_enabled']) ? 1 : 0; $lifetimeRatio = $data['lifetime_points_ratio'] ?? null; @@ -85,10 +94,11 @@ class PlayxConfig extends Backend $now = time(); if (!$row) { $effectiveOn = $mallOpenDate !== null ? MallPointsConversion::nextCalendarDate() : null; + $cashPersist = $cashF ?? MallBusinessConfig::DEFAULT_POINTS_TO_CASH_RATIO; MallBusinessConfig::create([ 'return_ratio' => $returnF, 'unlock_ratio' => $unlockF, - 'points_to_cash_ratio' => $cashF, + 'points_to_cash_ratio' => $cashPersist, 'daily_points_enabled' => $dailyEnabled, 'lifetime_points_enabled' => $lifetimeEnabled, 'lifetime_points_ratio' => $lifetimeRatioF, @@ -112,7 +122,9 @@ class PlayxConfig extends Backend $row->return_ratio = $returnF; $row->unlock_ratio = $unlockF; - $row->points_to_cash_ratio = $cashF; + if ($cashF !== null) { + $row->points_to_cash_ratio = $cashF; + } $row->daily_points_enabled = $dailyEnabled; $row->lifetime_points_enabled = $lifetimeEnabled; $row->lifetime_points_ratio = $lifetimeRatioF; diff --git a/web/src/lang/backend/en/mall/item.ts b/web/src/lang/backend/en/mall/item.ts index 388c358..77224b5 100644 --- a/web/src/lang/backend/en/mall/item.ts +++ b/web/src/lang/backend/en/mall/item.ts @@ -8,12 +8,19 @@ export default { description_ms: 'Description (Malay)', remark: 'Remark', score: 'Points', + score_tip: 'Available points deducted when the user redeems this item.', type: 'Type', 'type 1': 'Bonus', 'type 2': 'Physical', 'type 3': 'Withdraw', amount: 'Cash amount', + amount_tip: 'Cash granted on redemption (stored on the order). You may use the suggested value below (points × mall reference ratio) or enter your own.', + amount_suggested: 'Suggested cash amount: {amount} ({score} points × ratio {ratio})', + amount_apply_suggested: 'Use suggested amount', + amount_ratio_missing: 'Mall points-to-cash reference ratio is unavailable; enter cash amount manually.', + points_to_cash_ratio_label: 'Reference ratio', multiplier: 'Turnover multiplier', + multiplier_tip: 'Turnover requirement sent with bonus/withdraw grant.', category: 'Category', category_title: 'Category title', admin_id: 'Created by', diff --git a/web/src/lang/backend/en/mall/pageIntro.ts b/web/src/lang/backend/en/mall/pageIntro.ts index a580162..f698e50 100644 --- a/web/src/lang/backend/en/mall/pageIntro.ts +++ b/web/src/lang/backend/en/mall/pageIntro.ts @@ -57,6 +57,6 @@ export default { }, playxConfig: { title: 'About this page', - desc: 'Split into Event and General tabs: event start/end dates (effective next day; no conversion for end-day business data from the day after end), point sources and lifetime batch job; unlock and cash ratios under General.', + desc: 'General tab first: daily claim cap ratio. Event tab: dates, point sources, lifetime batch job. Product points and cash face value are set per item in Product management.', }, } diff --git a/web/src/lang/backend/en/mall/playxConfig.ts b/web/src/lang/backend/en/mall/playxConfig.ts index 9dfdbeb..b15c389 100644 --- a/web/src/lang/backend/en/mall/playxConfig.ts +++ b/web/src/lang/backend/en/mall/playxConfig.ts @@ -1,6 +1,6 @@ export default { - tab_event: 'Event settings', tab_regular: 'General settings', + tab_event: 'Event settings', section_event_period: 'Event period', section_daily_source: 'Source 1: yesterday net win/loss', daily_points_enabled: 'Enable daily loss to points', @@ -24,9 +24,8 @@ export default { mall_event_end_date_tip: 'Takes effect the next day; leave empty for no end. On the day after end, rows for the end business date no longer convert points or unlock cap; later business dates are excluded too.', active_event_end_date: 'Active end date', event_end_before_start: 'End date cannot be earlier than start date', - section_other: 'Other settings', - unlock_ratio: 'Unlock ratio (unlock_ratio)', - unlock_ratio_tip: 'Daily push: daily claim cap = yesterday total deposit × this ratio (within event window).', - points_to_cash_ratio: 'Points to cash ratio', - points_to_cash_ratio_tip: 'For withdrawable cash display: cash ≈ available points × this ratio.', + unlock_ratio: 'Daily claim cap ratio', + unlock_ratio_tip: 'Daily push: today claim cap = yesterday total deposit × this ratio (within event window).', + points_to_cash_ratio: 'Points-to-cash reference ratio', + points_to_cash_ratio_tip: 'Asset API withdrawable_cash = available points × this ratio. Suggested cash face value on bonus/withdraw items = redemption points × this ratio (editable per item).', } diff --git a/web/src/lang/backend/en/mall/userAsset.ts b/web/src/lang/backend/en/mall/userAsset.ts index 535a3ae..8ac1389 100644 --- a/web/src/lang/backend/en/mall/userAsset.ts +++ b/web/src/lang/backend/en/mall/userAsset.ts @@ -7,11 +7,13 @@ export default { available_points: 'Available points', adjust_available_points: 'Adjust points', today_limit: 'Daily claim cap', + today_limit_tip: 'Usually set by daily push: yesterday total deposit × unlock ratio in mall settings; 0 when the event is closed or settlement is not allowed. See “Daily cap date” for the business day. Manual edits here may be overwritten on the next successful push.', today_claimed: 'Claimed today', today_limit_date: 'Daily cap date', points_claim_cap: 'Lifetime claim cap', total_points_claimed: 'Total points claimed', - event_period_win_loss_net: 'Event period net W/L (adds while open, pauses when closed, resumes on reopen)', + event_period_win_loss_net: 'Event period cumulative net W/L', + event_period_win_loss_net_tip: 'Adds yesterday net win/loss from each daily push while the event is open; pauses when closed; resumes when reopened without reset.', create_time: 'Created at', update_time: 'Updated at', 'quick Search Fields': 'ID, PlayX user ID, username, phone', diff --git a/web/src/lang/backend/zh-cn/mall/item.ts b/web/src/lang/backend/zh-cn/mall/item.ts index ccdcbd5..8bc7aad 100644 --- a/web/src/lang/backend/zh-cn/mall/item.ts +++ b/web/src/lang/backend/zh-cn/mall/item.ts @@ -8,12 +8,19 @@ export default { description_ms: '描述(马来语)', remark: '备注', score: '兑换积分', + score_tip: '用户兑换本商品时扣除的可用积分。', type: '类型', 'type 1': '红利(BONUS)', 'type 2': '实物(PHYSICAL)', 'type 3': '提现(WITHDRAW)', amount: '现金面值', + amount_tip: '兑换成功后写入订单并推送给 PlayX 的现金金额。可参考下方建议值(兑换积分 × 商城积分兑现金参考比例),也可按业务自行填写。', + amount_suggested: '建议现金面值:{amount}(兑换积分 {score} × 比例 {ratio})', + amount_apply_suggested: '填入建议金额', + amount_ratio_missing: '暂未读取到商城「积分兑现金参考比例」,建议金额无法计算;现金面值请手工填写。', + points_to_cash_ratio_label: '当前参考比例', multiplier: '流水倍数', + multiplier_tip: '红利/提现发放时一并推送的流水倍数要求。', category: '红利业务类别', category_title: '类别展示名', admin_id: '创建管理员', diff --git a/web/src/lang/backend/zh-cn/mall/pageIntro.ts b/web/src/lang/backend/zh-cn/mall/pageIntro.ts index 29c2cc1..adf74ef 100644 --- a/web/src/lang/backend/zh-cn/mall/pageIntro.ts +++ b/web/src/lang/backend/zh-cn/mall/pageIntro.ts @@ -57,6 +57,6 @@ export default { }, playxConfig: { title: '页面说明', - desc: '分为「活动配置」与「常规配置」:活动开始/结束日(隔日生效,结束日次日起不再折算该日业务数据的昨日净输赢与解锁上限)、两种积分来源及终身一键计算;常规项为解锁比例与积分折现比例。', + desc: '「常规配置」:今日积分领取上限比例、积分兑现金参考比例(资产展示与商品现金面值建议);「活动配置」含活动起止日与积分来源。', }, } diff --git a/web/src/lang/backend/zh-cn/mall/playxConfig.ts b/web/src/lang/backend/zh-cn/mall/playxConfig.ts index 85681fe..8ef3f4e 100644 --- a/web/src/lang/backend/zh-cn/mall/playxConfig.ts +++ b/web/src/lang/backend/zh-cn/mall/playxConfig.ts @@ -1,6 +1,6 @@ export default { - tab_event: '活动配置', tab_regular: '常规配置', + tab_event: '活动配置', section_event_period: '活动时间', section_daily_source: '积分来源一:昨日净输赢', daily_points_enabled: '启用昨日净输赢转积分', @@ -24,9 +24,8 @@ export default { mall_event_end_date_tip: '设置后隔日生效,可留空表示不限制结束。结束日次日不再对结束日当天业务数据的昨日净输赢折算积分与解锁上限;结束日之后的业务日期也不再折算。', active_event_end_date: '当前生效的结束日', event_end_before_start: '活动结束日不能早于开始日', - section_other: '其他参数', - unlock_ratio: '解锁比例(unlock_ratio)', - unlock_ratio_tip: '每日推送中:今日可领取上限 = 昨日总充值 × 本比例(受活动时间规则约束)。', - points_to_cash_ratio: '积分折算现金比例', - points_to_cash_ratio_tip: '用于资产接口中「可提现现金」等展示:现金 ≈ 可用积分 × 本比例。', + unlock_ratio: '今日积分领取上限比例', + unlock_ratio_tip: '每日推送:今日可领取上限 = 昨日总充值 × 本比例(受活动时间规则约束)。', + points_to_cash_ratio: '积分兑现金参考比例', + points_to_cash_ratio_tip: '资产接口 withdrawable_cash = 可用积分 × 本比例;商品管理添加红利/提现商品时,「现金面值」建议金额 = 兑换积分 × 本比例(可手工覆盖)。', } diff --git a/web/src/lang/backend/zh-cn/mall/userAsset.ts b/web/src/lang/backend/zh-cn/mall/userAsset.ts index ee2a53c..044fa20 100644 --- a/web/src/lang/backend/zh-cn/mall/userAsset.ts +++ b/web/src/lang/backend/zh-cn/mall/userAsset.ts @@ -7,11 +7,13 @@ export default { available_points: '可用积分', adjust_available_points: '调整积分', today_limit: '今日可领取上限', + today_limit_tip: '一般由每日推送自动写入:昨日总充值 × 商城参数「今日积分领取上限比例」;活动关闭或不允许结算时为 0。对应业务日见「今日上限日期」。后台可手工改,下次成功推送可能覆盖。', today_claimed: '今日已领取', today_limit_date: '今日上限日期', points_claim_cap: '领取积分上限', total_points_claimed: '累计已领取积分', - event_period_win_loss_net: '活动期累计净输赢(开放时累加,关闭暂停,再开续累)', + event_period_win_loss_net: '活动期间累积净输赢', + event_period_win_loss_net_tip: '活动开放时按每日推送的「昨日净输赢」累加;关闭期间不累加,再次开启后接着累加,不重置。', create_time: '创建时间', update_time: '修改时间', 'quick Search Fields': 'ID、playX用户ID、用户名、手机号', diff --git a/web/src/views/backend/mall/item/popupForm.vue b/web/src/views/backend/mall/item/popupForm.vue index 0a7ee9f..e918396 100644 --- a/web/src/views/backend/mall/item/popupForm.vue +++ b/web/src/views/backend/mall/item/popupForm.vue @@ -96,26 +96,40 @@ type="number" v-model="baTable.form.items!.score" prop="score" + :block-help="t('mall.item.score_tip')" :input-attr="{ step: 1 }" :placeholder="t('Please input field', { field: t('mall.item.score') })" /> - + + +
+ {{ suggestedAmountHint }} + + {{ t('mall.item.amount_apply_suggested') }} + +
+
+ {{ t('mall.item.amount_ratio_missing') }} +
+
{{ amountBlockHelp }}
+
@@ -190,8 +204,9 @@ - + diff --git a/web/src/views/backend/mall/playxConfig/index.vue b/web/src/views/backend/mall/playxConfig/index.vue index e383f17..e0a499c 100644 --- a/web/src/views/backend/mall/playxConfig/index.vue +++ b/web/src/views/backend/mall/playxConfig/index.vue @@ -15,6 +15,33 @@ @keyup.enter="onSubmit()" > + + + +
{{ t('mall.playxConfig.unlock_ratio_tip') }}
+
+ + +
{{ t('mall.playxConfig.points_to_cash_ratio_tip') }}
+
+
+ {{ t('mall.playxConfig.section_event_period') }} @@ -94,34 +121,6 @@
{{ t('mall.playxConfig.calculate_lifetime_tip') }}
- - - {{ t('mall.playxConfig.section_other') }} - - -
{{ t('mall.playxConfig.unlock_ratio_tip') }}
-
- - -
{{ t('mall.playxConfig.points_to_cash_ratio_tip') }}
-
-
@@ -150,14 +149,14 @@ const loading = ref(true) const submitting = ref(false) const calculating = ref(false) const remark = ref('') -const activeTab = ref('event') +const activeTab = ref('regular') const activeMallOpenDate = ref('') const activeEventEndDate = ref('') const form = reactive({ return_ratio: 0.1, unlock_ratio: 0.1, - points_to_cash_ratio: 0.1, + points_to_cash_ratio: 0.01, daily_points_enabled: true, lifetime_points_enabled: false, lifetime_points_ratio: 0.1, diff --git a/web/src/views/backend/mall/userAsset/index.vue b/web/src/views/backend/mall/userAsset/index.vue index fe4e987..d7e603f 100644 --- a/web/src/views/backend/mall/userAsset/index.vue +++ b/web/src/views/backend/mall/userAsset/index.vue @@ -120,7 +120,8 @@ const baTable = new baTableClass( label: t('mall.userAsset.event_period_win_loss_net'), prop: 'event_period_win_loss_net', align: 'center', - minWidth: 160, + minWidth: 140, + showOverflowTooltip: true, operator: 'RANGE', sortable: true, }, diff --git a/web/src/views/backend/mall/userAsset/popupForm.vue b/web/src/views/backend/mall/userAsset/popupForm.vue index 596b864..bd52967 100644 --- a/web/src/views/backend/mall/userAsset/popupForm.vue +++ b/web/src/views/backend/mall/userAsset/popupForm.vue @@ -74,6 +74,7 @@ type="number" v-model="baTable.form.items!.today_limit" prop="today_limit" + :block-help="t('mall.userAsset.today_limit_tip')" :input-attr="{ step: 1, min: 0 }" :placeholder="t('Please input field', { field: t('mall.userAsset.today_limit') })" /> @@ -82,6 +83,7 @@ type="number" v-model="baTable.form.items!.event_period_win_loss_net" prop="event_period_win_loss_net" + :block-help="t('mall.userAsset.event_period_win_loss_net_tip')" :input-attr="{ disabled: true, step: 0.01 }" />