1.修改电话号码格式为60前缀,马来西亚格式
2.优化渠道可以查看分红方式,可以查看游玩详情
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ class BetOrder extends Backend
|
||||
list($where, $alias, $limit, $order) = $this->queryBuilder();
|
||||
$table = strtolower($this->model->getTable());
|
||||
$mainShort = $alias[$table] ?? '';
|
||||
if ($mainShort !== '' && $this->auth && !$this->auth->isSuperAdmin()) {
|
||||
if ($mainShort !== '' && $this->shouldApplyUserAdminScope()) {
|
||||
$where[] = ['user.admin_id', 'in', $this->scopedAdminIds()];
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class DepositOrder extends Backend
|
||||
list($where, $alias, $limit, $order) = $this->queryBuilder();
|
||||
$table = strtolower($this->model->getTable());
|
||||
$mainShort = $alias[$table] ?? '';
|
||||
if ($mainShort !== '' && $this->auth && !$this->auth->isSuperAdmin()) {
|
||||
if ($mainShort !== '' && $this->shouldApplyUserAdminScope()) {
|
||||
$where[] = ['user.admin_id', 'in', $this->scopedAdminIds()];
|
||||
}
|
||||
$this->appendDepositOrderIndexWhere($where, $mainShort);
|
||||
@@ -129,7 +129,7 @@ class DepositOrder extends Backend
|
||||
|
||||
private function checkChannelScoped(array $row): bool
|
||||
{
|
||||
if (!$this->auth || $this->auth->isSuperAdmin()) {
|
||||
if (!$this->auth || $this->auth->isSuperAdmin() || $this->hasGlobalReadScope()) {
|
||||
return true;
|
||||
}
|
||||
$userRow = $row['user'] ?? null;
|
||||
|
||||
@@ -49,7 +49,7 @@ class WithdrawOrder extends Backend
|
||||
list($where, $alias, $limit, $order) = $this->queryBuilder();
|
||||
$table = strtolower($this->model->getTable());
|
||||
$mainShort = $alias[$table] ?? '';
|
||||
if ($mainShort !== '' && $this->auth && !$this->auth->isSuperAdmin()) {
|
||||
if ($mainShort !== '' && $this->shouldApplyUserAdminScope()) {
|
||||
$where[] = ['user.admin_id', 'in', $this->scopedAdminIds()];
|
||||
}
|
||||
|
||||
@@ -658,7 +658,7 @@ class WithdrawOrder extends Backend
|
||||
|
||||
private function checkChannelScoped(array|object $row): bool
|
||||
{
|
||||
if (!$this->auth || $this->auth->isSuperAdmin()) {
|
||||
if (!$this->auth || $this->auth->isSuperAdmin() || $this->hasGlobalReadScope()) {
|
||||
return true;
|
||||
}
|
||||
$uidRaw = is_array($row) ? ($row['user_id'] ?? null) : ($row->user_id ?? null);
|
||||
|
||||
Reference in New Issue
Block a user