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

@@ -6,6 +6,7 @@ namespace app\common\controller;
use Throwable;
use app\admin\library\Auth;
use app\common\service\AdminChannelScopeService;
use app\common\library\token\TokenExpirationException;
use app\admin\library\traits\Backend as BackendTrait;
use support\Response;
@@ -421,7 +422,7 @@ class Backend extends Api
*/
protected function getDataLimitAdminIds(): array
{
if (!$this->dataLimit || !$this->auth || $this->auth->isSuperAdmin()) {
if (!$this->dataLimit || !$this->auth || $this->auth->isSuperAdmin() || $this->hasGlobalReadScope()) {
return [];
}
$adminIds = [];
@@ -475,6 +476,51 @@ class Backend extends Api
return get_controller_path($request);
}
/**
* 全平台只读范围:角色组均未绑定渠道,或拥有查看所有渠道权限,或超管
*/
protected function hasGlobalReadScope(): bool
{
return $this->auth !== null && AdminChannelScopeService::hasGlobalReadScope($this->auth);
}
/**
* 是否按「名下管理员/用户」收窄列表(非超管且非全平台只读范围)
*/
protected function shouldApplyUserAdminScope(): bool
{
if ($this->auth === null || !$this->auth->isLogin()) {
return false;
}
if ($this->auth->isSuperAdmin() || $this->hasGlobalReadScope()) {
return false;
}
return true;
}
/**
* 可读渠道 IDnull 表示全部渠道
*
* @return array<int, int>|null
*/
protected function readableChannelIds(): ?array
{
if ($this->auth === null) {
return [0];
}
return AdminChannelScopeService::readableChannelIds($this->auth);
}
/**
* 列表是否需要按 channel_id 收窄
*/
protected function shouldApplyChannelIdScope(): bool
{
return $this->readableChannelIds() !== null;
}
/**
* 构造权限节点候选:兼容 snake_case 与 camelCase 节点名
*