mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 10:08:05 +00:00
Fix FLEXIAPI-412 Restrict the default messages statistics graph to the space...
This commit is contained in:
parent
26aaab2f07
commit
abcc9c1c7b
2 changed files with 10 additions and 6 deletions
|
|
@ -106,9 +106,13 @@ class StatisticsController extends Controller
|
||||||
$fromQuery = StatisticsCall::query();
|
$fromQuery = StatisticsCall::query();
|
||||||
$toQuery = StatisticsCall::query();
|
$toQuery = StatisticsCall::query();
|
||||||
|
|
||||||
if ($request->get('domain')) {
|
$domain = $request->user()->superAdmin
|
||||||
$fromQuery->where('to_domain', $request->get('domain'));
|
? $request->get('domain')
|
||||||
$toQuery->where('from_domain', $request->get('domain'));
|
: $request->space->domain;
|
||||||
|
|
||||||
|
if ($domain) {
|
||||||
|
$fromQuery->where('to_domain', $domain);
|
||||||
|
$toQuery->where('from_domain', $domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request->get('to')) {
|
if ($request->get('to')) {
|
||||||
|
|
|
||||||
|
|
@ -57,9 +57,9 @@ class StatisticsGraphFactory
|
||||||
$fromQuery = StatisticsMessage::query();
|
$fromQuery = StatisticsMessage::query();
|
||||||
$toQuery = StatisticsMessage::query();
|
$toQuery = StatisticsMessage::query();
|
||||||
|
|
||||||
if (!Auth::user()?->admin) {
|
if (!Auth::user()?->superAdmin) {
|
||||||
$fromQuery->where('from_domain', space()->domain);
|
$fromQuery->where('from_domain', $this->request->space->domain);
|
||||||
$toQuery->toDomain($this->domain);
|
$toQuery->toDomain(space()->domain);
|
||||||
} elseif ($this->domain) {
|
} elseif ($this->domain) {
|
||||||
$fromQuery->where('from_domain', $this->domain);
|
$fromQuery->where('from_domain', $this->domain);
|
||||||
$toQuery->toDomain($this->domain);
|
$toQuery->toDomain($this->domain);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue