1.优化渠道管理中直属投注额度和总投注额度

2.管理员管理中三个菜单数据显示限制
This commit is contained in:
2026-05-30 15:53:36 +08:00
parent 16a7ef7413
commit f6197a9af5
13 changed files with 195 additions and 92 deletions

View File

@@ -42,9 +42,9 @@ class AdminWithdrawOrder extends Backend
list($where, $alias, $limit, $order) = $this->queryBuilder();
$table = strtolower($this->model->getTable());
$mainShort = $alias[$table] ?? '';
$channelScope = $this->readableChannelIds();
if ($mainShort !== '' && $channelScope !== null) {
$where[] = [$mainShort . '.channel_id', 'in', $channelScope];
$scopedAdminIds = $this->getManageableScopeAdminIds();
if ($mainShort !== '' && $scopedAdminIds !== []) {
$where[] = [$mainShort . '.admin_id', 'in', $scopedAdminIds];
}
$res = $this->model
->withJoin($this->withJoinTable, $this->withJoinType)
@@ -171,9 +171,9 @@ class AdminWithdrawOrder extends Backend
return $response;
}
$query = Db::name('admin_withdraw_order');
$channelScope = $this->readableChannelIds();
if ($channelScope !== null) {
$query->where('channel_id', 'in', $channelScope);
$scopedAdminIds = $this->getManageableScopeAdminIds();
if ($scopedAdminIds !== []) {
$query->where('admin_id', 'in', $scopedAdminIds);
}
$rows = $query->field(['status', 'amount', 'actual_amount'])->select()->toArray();
$total = count($rows);
@@ -232,16 +232,16 @@ class AdminWithdrawOrder extends Backend
if ($this->auth->isSuperAdmin() || $this->hasGlobalReadScope()) {
return true;
}
$channelId = intval($order['channel_id'] ?? 0);
if ($channelId <= 0) {
$adminId = intval($order['admin_id'] ?? 0);
if ($adminId <= 0) {
return false;
}
$allowed = $this->readableChannelIds();
if ($allowed === null) {
$scopedAdminIds = $this->getManageableScopeAdminIds();
if ($scopedAdminIds === []) {
return true;
}
return in_array($channelId, $allowed, true);
return in_array($adminId, $scopedAdminIds, true);
}
}