1.新增获取充值/提现配置接口/api/finance/depositWithdrawConfig
2.优化充值和提现方式
This commit is contained in:
@@ -4,7 +4,6 @@ namespace app\admin\controller\config;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use app\common\library\game\DepositChannel as DepositChannelLib;
|
||||
use app\common\library\game\DepositTier as DepositTierLib;
|
||||
use app\common\library\game\FinanceCashierConfig as FinanceCashierConfigLib;
|
||||
use app\common\service\GameHotDataCoordinator;
|
||||
use app\common\service\GameHotDataLock;
|
||||
@@ -56,7 +55,7 @@ class DepositChannel extends Backend
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表(baTable:list / total / remark)+ registry + tier_options(弹窗用)
|
||||
* 列表(baTable:list / total / remark)+ registry(弹窗展示名)
|
||||
*/
|
||||
public function index(WebmanRequest $request): Response
|
||||
{
|
||||
@@ -71,7 +70,6 @@ class DepositChannel extends Backend
|
||||
return $this->error(__('Parameter error'));
|
||||
}
|
||||
|
||||
$tierOptions = $this->buildTierOptions();
|
||||
$registryOut = $this->buildRegistryOut();
|
||||
|
||||
$parsed = DepositChannelLib::parseStoredOverridesFromDb();
|
||||
@@ -136,7 +134,6 @@ class DepositChannel extends Backend
|
||||
'total' => $total,
|
||||
'remark' => '',
|
||||
'registry' => $registryOut,
|
||||
'tier_options' => $tierOptions,
|
||||
'items' => $pageRows,
|
||||
]);
|
||||
}
|
||||
@@ -308,32 +305,6 @@ class DepositChannel extends Backend
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{id: string, label: string}>
|
||||
*/
|
||||
private function buildTierOptions(): array
|
||||
{
|
||||
$tierRow = Db::name('game_config')->where('config_key', DepositTierLib::CONFIG_KEY)->find();
|
||||
$allTiers = DepositTierLib::parseFromConfigValue($tierRow['config_value'] ?? null);
|
||||
$tierOptions = [];
|
||||
foreach ($allTiers as $t) {
|
||||
if (!is_array($t)) {
|
||||
continue;
|
||||
}
|
||||
$tid = isset($t['id']) && is_string($t['id']) ? $t['id'] : '';
|
||||
if ($tid === '') {
|
||||
continue;
|
||||
}
|
||||
$title = isset($t['title']) && is_string($t['title']) ? trim($t['title']) : '';
|
||||
$tierOptions[] = [
|
||||
'id' => $tid,
|
||||
'label' => $title !== '' ? $title . ' (' . $tid . ')' : $tid,
|
||||
];
|
||||
}
|
||||
|
||||
return $tierOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array{name: string, name_en: string, sort: int}>
|
||||
*/
|
||||
@@ -376,12 +347,6 @@ class DepositChannel extends Backend
|
||||
} else {
|
||||
$form['status'] = $current['status'] ?? 0;
|
||||
}
|
||||
if (array_key_exists('tier_ids', $payload) && is_array($payload['tier_ids'])) {
|
||||
$form['tier_ids'] = $payload['tier_ids'];
|
||||
} else {
|
||||
$form['tier_ids'] = isset($current['tier_ids']) && is_array($current['tier_ids']) ? $current['tier_ids'] : [];
|
||||
}
|
||||
|
||||
return $this->normalizeChannelFormRow($form, $code);
|
||||
}
|
||||
|
||||
@@ -398,24 +363,11 @@ class DepositChannel extends Backend
|
||||
if ($st === true || $st === 1 || $st === '1') {
|
||||
$status = 1;
|
||||
}
|
||||
$tierIds = [];
|
||||
if (isset($payload['tier_ids']) && is_array($payload['tier_ids'])) {
|
||||
foreach ($payload['tier_ids'] as $tid) {
|
||||
if (is_string($tid)) {
|
||||
$t = trim($tid);
|
||||
if ($t !== '' && preg_match('/^[a-zA-Z0-9_\-]{1,32}$/', $t)) {
|
||||
$tierIds[] = $t;
|
||||
}
|
||||
}
|
||||
}
|
||||
$tierIds = array_values(array_unique($tierIds));
|
||||
}
|
||||
|
||||
return [
|
||||
'code' => $code,
|
||||
'sort' => $sort,
|
||||
'status' => $status,
|
||||
'tier_ids' => $tierIds,
|
||||
'tier_ids' => [],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user