From 8f6837485aebc68c1d167e2d52af8eb77ba9c6f1 Mon Sep 17 00:00:00 2001 From: Venkata Chandra Sekhar Nainala Date: Tue, 20 Aug 2024 17:09:28 +0200 Subject: [PATCH] fix: updated total molecules query --- app/Console/Commands/DashWidgetsRefresh.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Console/Commands/DashWidgetsRefresh.php b/app/Console/Commands/DashWidgetsRefresh.php index e4b5a62a..05da41ed 100644 --- a/app/Console/Commands/DashWidgetsRefresh.php +++ b/app/Console/Commands/DashWidgetsRefresh.php @@ -78,7 +78,7 @@ public function handle() $this->info('Cache for molecules parent refreshed.'); Cache::rememberForever('stats.molecules', function () { - return DB::table('molecules')->selectRaw('count(*)')->whereRaw('has_stereo=false and is_parent=false and active=true')->get()[0]->count + DB::table('molecules')->selectRaw('count(*)')->whereRaw('has_stereo=true and active=true')->get()[0]->count; + return DB::table('molecules')->selectRaw('count(*)')->whereRaw('active=true and NOT (is_parent=true AND has_variants=true)')->get()[0]->count; }); $this->info('Cache for molecules refreshed.');