mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-01-22 18:48:14 -05:00
Merge remote-tracking branch 'upstream/dev' into feature/v2rayng-hysteria2
This commit is contained in:
commit
8737e0a6eb
@ -108,14 +108,14 @@ class StatisticalService
|
|||||||
/**
|
/**
|
||||||
* 获取指定用户的流量使用情况
|
* 获取指定用户的流量使用情况
|
||||||
*/
|
*/
|
||||||
public function getStatUserByUserID($userId): array
|
public function getStatUserByUserID(int|string $userId): array
|
||||||
{
|
{
|
||||||
|
|
||||||
$stats = [];
|
$stats = [];
|
||||||
$statsUser = $this->redis->zrange($this->statUserKey, 0, -1, true);
|
$statsUser = $this->redis->zrange($this->statUserKey, 0, -1, true);
|
||||||
foreach ($statsUser as $member => $value) {
|
foreach ($statsUser as $member => $value) {
|
||||||
list($rate, $uid, $type) = explode('_', $member);
|
list($rate, $uid, $type) = explode('_', $member);
|
||||||
if ($uid !== $userId)
|
if (intval($uid) !== intval($userId))
|
||||||
continue;
|
continue;
|
||||||
$key = "{$rate}_{$uid}";
|
$key = "{$rate}_{$uid}";
|
||||||
$stats[$key] = $stats[$key] ?? [
|
$stats[$key] = $stats[$key] ?? [
|
||||||
|
Loading…
Reference in New Issue
Block a user