]> _ Git - psq.git/commitdiff
metrics
authorLouis Jeckel <louis.jeckel@outlook.cm>
Fri, 11 Sep 2020 16:42:05 +0000 (18:42 +0200)
committerLouis Jeckel <louis.jeckel@outlook.cm>
Fri, 11 Sep 2020 16:42:05 +0000 (18:42 +0200)
app/Nova/Metrics/FileAccess.php
app/Nova/Metrics/RegistrationCompletePartition.php
app/Nova/Metrics/TotalUsers.php
app/Nova/Metrics/UsersPartition.php
app/User.php

index 06e9a73ca16f4de1e01f81be30837583988d7b74..9a8c5caea6f1deadcf54ce8555e5ea066ce23e3f 100644 (file)
@@ -30,9 +30,9 @@ class FileAccess extends Value
     public function ranges()
     {
         return [
-            30 => '30 jours',
             'TODAY' => 'Today',
             7 => '7 jours',
+            30 => '30 jours',
             60 => '60 jours',
             365 => '365 jours',
             'MTD' => 'Month To Date',
index ca0499a6b672eedca1bd57b110516e001cd5fc87..a2337db389a33625aa5f3ddaef48920839ea8147 100644 (file)
@@ -20,8 +20,8 @@ class RegistrationCompletePartition extends Partition
     public function calculate(NovaRequest $request)
     {
         return $this->result([
-            'Compte activé' => User::registrationComplete()->count(),
-            'Compte non activé' => User::registrationIncomplete()->count(),
+            'Compte activé' => User::registeredUser()->registrationComplete()->count(),
+            'Compte non activé' => User::registeredUser()->registrationIncomplete()->count(),
         ]);
     }
 
@@ -44,5 +44,5 @@ class RegistrationCompletePartition extends Partition
     {
         return 'registration-complete';
     }
-    
+
 }
index 6ba37f945d9ad79965513dd81767ddd73ffdaa77..6a70a8419a1b158c0efe2ec85f986513a6799a46 100644 (file)
@@ -18,7 +18,7 @@ class TotalUsers extends Value
      */
     public function calculate(NovaRequest $request)
     {
-        return $this->result(User::count());
+        return $this->result(User::registeredUser()->count());
     }
 
 
index ee9bd9c17fab0597b9fdc3d216fefd37c8971442..0e271ef444e142f0753e8f2a961b7f94a9fba363 100644 (file)
@@ -23,7 +23,8 @@ class UsersPartition extends Partition
             'Abonnés (groupe)' => $g = User::hasOrgSubscription()->count(),
             'Abonnés (indiv)' => $i = User::hasIndSubscription()->count(),
             "Période d'essai" => $t = User::isOnTrial()->count(),
-            "Reste" => User::count() - $i - $g - $t
+            "Découverte" => $d = User::isOnDiscovery()->count(),
+            "Reste" => User::count() - $i - $g - $t -$d
         ]);
     }
 
index e35109e610168b03efc182950a46df16485adca6..0b7ef00c6d1e9834eb51bd8b77b87b67351fed00 100644 (file)
@@ -260,7 +260,7 @@ class User extends Authenticatable implements MustVerifyEmail
     /**
      * @return bool
      */
-    public function isOnDiscovery(): bool
+    public function isOnDiscoverUser(): bool
     {
         return $this->discover_ends_at !== null &&
             $this->discover_ends_at->isFuture();
@@ -437,7 +437,7 @@ class User extends Authenticatable implements MustVerifyEmail
                 break;
 
             case self::TYPE_DISCOVER:
-                if($this->isOnDiscovery()) {
+                if($this->isOnDiscoverUser()) {
                     $id = 'discover';
                 } else if ($this->discover_ends_at === null){
                     $id = 'inactive';