1.修改电话号码格式为60前缀,马来西亚格式

2.优化渠道可以查看分红方式,可以查看游玩详情
This commit is contained in:
2026-05-30 11:09:54 +08:00
parent 28d0100d5a
commit e65c3474bd
37 changed files with 1772 additions and 113 deletions

View File

@@ -42,8 +42,9 @@ class AdminWithdrawOrder extends Backend
list($where, $alias, $limit, $order) = $this->queryBuilder();
$table = strtolower($this->model->getTable());
$mainShort = $alias[$table] ?? '';
if ($mainShort !== '' && $this->auth && !$this->auth->isSuperAdmin()) {
$where[] = [$mainShort . '.channel_id', 'in', $this->getCurrentAdminChannelIds()];
$channelScope = $this->readableChannelIds();
if ($mainShort !== '' && $channelScope !== null) {
$where[] = [$mainShort . '.channel_id', 'in', $channelScope];
}
$res = $this->model
->withJoin($this->withJoinTable, $this->withJoinType)
@@ -170,8 +171,9 @@ class AdminWithdrawOrder extends Backend
return $response;
}
$query = Db::name('admin_withdraw_order');
if ($this->auth && !$this->auth->isSuperAdmin()) {
$query->where('channel_id', 'in', $this->getCurrentAdminChannelIds());
$channelScope = $this->readableChannelIds();
if ($channelScope !== null) {
$query->where('channel_id', 'in', $channelScope);
}
$rows = $query->field(['status', 'amount', 'actual_amount'])->select()->toArray();
$total = count($rows);
@@ -227,53 +229,19 @@ class AdminWithdrawOrder extends Backend
if (!$this->auth) {
return false;
}
if ($this->auth->isSuperAdmin()) {
if ($this->auth->isSuperAdmin() || $this->hasGlobalReadScope()) {
return true;
}
$channelId = intval($order['channel_id'] ?? 0);
if ($channelId <= 0) {
return false;
}
$allowed = $this->getCurrentAdminChannelIds();
$allowed = $this->readableChannelIds();
if ($allowed === null) {
return true;
}
return in_array($channelId, $allowed, true);
}
/**
* 当前管理员可审核的渠道(优先取自身 channel_id同时兼容角色组继承链上的 channel_id
*
* @return int[]
*/
private function getCurrentAdminChannelIds(): array
{
$uid = intval($this->auth->id ?? 0);
if ($uid <= 0) {
return [0];
}
$channelIds = [];
$selfChannelId = intval(Db::name('admin')->where('id', $uid)->value('channel_id') ?? 0);
if ($selfChannelId > 0) {
$channelIds[] = $selfChannelId;
}
$groupIds = Db::name('admin_group_access')->where('uid', $uid)->column('group_id');
if ($groupIds !== []) {
$groupIds = array_values(array_unique(array_merge($groupIds, $this->auth->getAdminChildGroups())));
$rows = Db::name('admin_group')
->field(['id', 'channel_id'])
->where('id', 'in', $groupIds)
->whereNotNull('channel_id')
->select()
->toArray();
foreach ($rows as $row) {
$cid = intval($row['channel_id'] ?? 0);
if ($cid > 0) {
$channelIds[] = $cid;
}
}
}
return $channelIds === [] ? [0] : array_values(array_unique($channelIds));
}
}