Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #48

Merged
merged 141 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
d05d231
feat: implemented spotlight and various updates, bug fixes
CS76 Apr 9, 2024
3159085
fix resolved collection create bug and formatting updates
CS76 Apr 9, 2024
30768b3
fix: various bug fixes and ux/ui improvements
CS76 Apr 10, 2024
0bed1cb
fix: docker build issue fix
CS76 Apr 10, 2024
2193a8b
feat: added the feature to accept comma separated tags.
sriramkanakam87 Apr 11, 2024
a0c6ddd
feat: created the required tables for reporting functionality
sriramkanakam87 Apr 14, 2024
b4f4b77
feat: created the models and added relationships for the reporting fu…
sriramkanakam87 Apr 14, 2024
a8e242e
feat: created Reports resource
sriramkanakam87 Apr 14, 2024
2bf3427
feat: created the relationship manager for Reports, improved the tabl…
sriramkanakam87 Apr 14, 2024
8402f5c
fix: replaced the delete functionality with detach functionality for …
sriramkanakam87 Apr 14, 2024
0ea3d45
feat: created CitationsRelation manager for Reports resource.
sriramkanakam87 Apr 14, 2024
0648b71
feat: refactoring and other updates/bug fixes
CS76 Apr 15, 2024
caa8a92
Merge branch 'development' of https://github.com/Steinbeck-Lab/coconu…
CS76 Apr 15, 2024
0b7176e
fix: removed tailwind config import and reverted docker file updates
CS76 Apr 15, 2024
aa64222
feat: created MoleculesRelation manager for Reports and gave a separa…
sriramkanakam87 Apr 15, 2024
7bd2fdf
fix: created one to many relation between the models User and Report
sriramkanakam87 Apr 16, 2024
d02fa2e
feat: added approval functionality to the role Curator and modified L…
sriramkanakam87 Apr 16, 2024
89e4349
feat: created a ReportPolicy to fine tune authorisations (customisati…
sriramkanakam87 Apr 16, 2024
aa6b08d
feat: created policies for the resources, and put in place error hand…
sriramkanakam87 Apr 17, 2024
32af907
fix: user access
sriramkanakam87 Apr 18, 2024
c3abb8f
feat: event for saving an edited report is created
sriramkanakam87 Apr 18, 2024
0270a77
feat: users without a role now can only access reports that they crea…
sriramkanakam87 Apr 18, 2024
02ba9b0
feat: changed the name of the event ReportEdited to ReportStatusChang…
sriramkanakam87 Apr 18, 2024
5c49664
feat: event subscriber is created for the model report, and created n…
sriramkanakam87 Apr 18, 2024
93fc9cf
feat: setup a markdown notification and email template for report sta…
sriramkanakam87 Apr 18, 2024
017cf77
fix: updated the policies to allow user to create new reports and att…
sriramkanakam87 Apr 18, 2024
82f4a9a
feat: added view report functionality to allow user to view the repor…
sriramkanakam87 Apr 18, 2024
28d01b3
fix: added checks for the creation of report
sriramkanakam87 Apr 18, 2024
022a4c3
feat: now users can add collections, molecules or citations while cre…
sriramkanakam87 Apr 18, 2024
5f93e7c
feat: now users receive new mail after reporting
sriramkanakam87 Apr 18, 2024
5fdc58d
feat: part of previous commit
sriramkanakam87 Apr 18, 2024
cee868e
fix: added local env variable to allow proper redirection
sriramkanakam87 Apr 18, 2024
96715fc
feat: updated logo
Kohulan Apr 22, 2024
94473ab
Merge pull request #9 from Steinbeck-Lab/dev-kohulan
CS76 Apr 22, 2024
2ac35ca
fix: added variety of checks to hide and/or edit fields in accordance…
sriramkanakam87 Apr 23, 2024
191c605
fix: added a csv column to reports table to avoid preloading in the form
sriramkanakam87 Apr 23, 2024
319c64a
fix: query switched to unique cannonical smiles, other bug fixes and …
CS76 Apr 23, 2024
0e4796e
Merge branch 'development' of https://github.com/Steinbeck-Lab/coconu…
CS76 Apr 23, 2024
294a25c
feat: created geolocation and organism resources
sriramkanakam87 Apr 23, 2024
0cb7652
feat: created relationship managers for geolocation and organism
sriramkanakam87 Apr 23, 2024
d2278a6
feat: added relationship managers for report resource as well as one …
sriramkanakam87 Apr 24, 2024
48edf84
fix: parameterised the molecule in the frontend livewire view
sriramkanakam87 Apr 24, 2024
df4a61d
fix: made audits as the default tab for the report view after clickin…
sriramkanakam87 Apr 24, 2024
9c3e22b
feat: added default sort and tags for report resource
sriramkanakam87 Apr 24, 2024
1750c08
Merge pull request #10 from Steinbeck-Lab/feature-report-functionality
CS76 Apr 24, 2024
1a9c9c0
Merge branch 'development' into geo-organism-resources
sriramkanakam87 Apr 24, 2024
3e43bea
chore: nullified organism_parts and locations in the pivot tables for…
sriramkanakam87 Apr 24, 2024
c51050c
feat: created geolocation and organism resources and their relation m…
sriramkanakam87 Apr 25, 2024
35d1d1d
feat: generated policies for geolocation and organism
sriramkanakam87 Apr 25, 2024
aa4c86c
fix: gave view access to normal users for geolocations and organisms …
sriramkanakam87 Apr 25, 2024
276deb7
Merge pull request #12 from Steinbeck-Lab/geo-organism-resources
CS76 Apr 25, 2024
d8bd65e
fix: importer updates and formatting changes
CS76 Apr 25, 2024
edf2dbd
fix: filament route missing issue fix and composer update changes
CS76 Apr 25, 2024
1c64042
chore: added icons for geolocations and organisms, and ran pint
sriramkanakam87 Apr 25, 2024
8d3bbad
chore: removed unnecessary comments
sriramkanakam87 Apr 25, 2024
e738924
Merge branch 'development' into add-resource-icons
sriramkanakam87 Apr 25, 2024
f7d6d54
Merge pull request #13 from Steinbeck-Lab/add-resource-icons
CS76 Apr 25, 2024
174e96e
feat: add assign identifiers command
CS76 Apr 29, 2024
709e21c
feat: created dashboard widgets for all resources
sriramkanakam87 May 2, 2024
c4d7282
feat: created a view for collection and added widgets
sriramkanakam87 May 2, 2024
a5bc781
feat: created view page for molecule and added widgets
sriramkanakam87 May 2, 2024
7562377
feat: created view page for organism and added widgets
sriramkanakam87 May 2, 2024
be02cd8
feat: created view page for geolocation and added widgets
sriramkanakam87 May 3, 2024
18e57cb
feat: created a separate widget for molecules in the dashboard
sriramkanakam87 May 6, 2024
0a2bb27
chore: ran pint and deleted comments
sriramkanakam87 May 6, 2024
14b005a
fix: enabled tautomeric standardization, various import scripts and o…
CS76 May 6, 2024
bc3156d
Merge pull request #18 from Steinbeck-Lab/add-widget-functionality
CS76 May 6, 2024
bc94b89
Merge branch 'development' of https://github.com/Steinbeck-Lab/coconu…
CS76 May 6, 2024
5104dbf
chore: formatting updates
CS76 May 6, 2024
6130df4
feat: created molecule relation manger for collection resource, added…
sriramkanakam87 May 10, 2024
98d3ba4
feat: added button for publishing the collection.
sriramkanakam87 May 10, 2024
d825bc3
feat: scheduled a refresh of cache for dashboard widgets
sriramkanakam87 May 10, 2024
9b3cac4
feat: various updates and bug fixes
CS76 May 14, 2024
c6a1489
chore: ran pint
sriramkanakam87 May 14, 2024
ceb3a5a
chore: ran pint
sriramkanakam87 May 14, 2024
3765492
chore: ran pint
sriramkanakam87 May 14, 2024
e14219b
feat: added functionality to display the status of the collection
sriramkanakam87 May 14, 2024
220a730
Merge pull request #21 from Steinbeck-Lab/functionality-button-for-pr…
CS76 May 15, 2024
a608aca
Merge pull request #22 from Steinbeck-Lab/functionality-button-for-pu…
CS76 May 15, 2024
e08e647
Merge pull request #23 from Steinbeck-Lab/functionality-schedule-dash…
CS76 May 15, 2024
6772b7c
feat: bug fixes and other updates
CS76 May 15, 2024
2bb3144
Merge branch 'development' of https://github.com/Steinbeck-Lab/coconu…
CS76 May 15, 2024
3b84e5d
feat: ux/ui updates, text changes and commands added
CS76 May 23, 2024
428a201
feat: implemented social login, ui updates and bug fixes
CS76 May 24, 2024
2c451b0
fix: resolved molecule route issue
CS76 May 24, 2024
bf20706
feat: implemented REST API service and swagger documentation, migrate…
CS76 May 24, 2024
75e2121
feat: added command to generate api docs
CS76 May 24, 2024
4b9e8ae
feat: implemented citations, collections, organisms rest controllers …
CS76 May 24, 2024
b7fddc8
feat: added vitepress docs
CS76 May 24, 2024
e0ef6f7
wip: allows organism to be reported
sriramkanakam87 May 26, 2024
8ebfb66
feat: shows the related organisms in the relations in edit mode
sriramkanakam87 May 26, 2024
041b1bd
feat: displays tool tips for the report fields
sriramkanakam87 May 26, 2024
9ae31bf
fix: performance improvement for dashboard widgets using raw queries.
sriramkanakam87 May 26, 2024
6c00b12
fix: performance improvement for widgets in collections, geolocations…
sriramkanakam87 May 26, 2024
641ea96
feat: displays the counts of resources by the side
sriramkanakam87 May 27, 2024
698184c
feat: displays various counts in the collection table and added two w…
sriramkanakam87 May 27, 2024
2e97965
feat: a command to refresh widgets of dashboard, collections and geol…
sriramkanakam87 May 27, 2024
bfadb89
chore: ran pint
sriramkanakam87 May 27, 2024
c8aaf92
chore: ran pint
sriramkanakam87 May 27, 2024
c281a04
chore: ran pint
sriramkanakam87 May 27, 2024
fe9f538
chore: ran pint
sriramkanakam87 May 27, 2024
b50dc2e
chore: ran pint
sriramkanakam87 May 27, 2024
9506316
fix: queries in collection and geolocation stats inline with app cach…
sriramkanakam87 May 28, 2024
1bca5a6
chore: queries inline with app widget cache refresh
sriramkanakam87 May 28, 2024
675348b
chore: ran pint
sriramkanakam87 May 28, 2024
f5b032c
Update DashWidgetsRefresh.php
CS76 May 28, 2024
6a979d5
Merge pull request #45 from Steinbeck-Lab/feature-widget-refresh-command
CS76 May 28, 2024
e0788e2
Merge branch 'feature-resource-badges' into fix-raw-sql-widgets
sriramkanakam87 May 28, 2024
7bd2348
Merge branch 'feature-report-organism' into fix-raw-sql-widgets
sriramkanakam87 May 28, 2024
19bfbbc
Merge branch 'feature-widget-refresh-command' into fix-raw-sql-widgets
sriramkanakam87 May 28, 2024
707fc5a
Merge branch 'feature-enhance-reporting' into fix-raw-sql-widgets
sriramkanakam87 May 28, 2024
7db5483
Merge branch 'development' into fix-raw-sql-widgets
sriramkanakam87 May 28, 2024
c359562
Merge pull request #47 from Steinbeck-Lab/fix-raw-sql-widgets
CS76 May 28, 2024
2380fbf
feat: added docs and other command updates
CS76 May 28, 2024
eaa30b8
Merge branch 'development' of https://github.com/Steinbeck-Lab/coconu…
CS76 May 28, 2024
840404b
fix: cannot access offset of type string on string bug fix
CS76 May 28, 2024
76789b3
Update dev-build.yml
CS76 May 28, 2024
ceaa44b
fix: added cache to welcome page
CS76 May 28, 2024
b2697dc
Merge branch 'development' of https://github.com/Steinbeck-Lab/coconu…
CS76 May 28, 2024
97f9acb
feat: enabled cache and various bug fixes
CS76 May 29, 2024
822760b
feat: various ux/ui updates and other minor changes
CS76 May 29, 2024
b0fdbc9
fix: enforcing url https redirect
CS76 May 30, 2024
2e1d163
Update dev-build.yml
CS76 May 30, 2024
3afe3f7
feat: implemented advanced tables and various other minor updates
CS76 May 31, 2024
52206dc
Merge branch 'development' of https://github.com/Steinbeck-Lab/coconu…
CS76 May 31, 2024
00d4c22
fix: added composer private repo install capabilities
CS76 May 31, 2024
a894fad
fix: added css from vendor folders
CS76 May 31, 2024
a669d6e
fix: malformed auth.json bug fix
CS76 May 31, 2024
5be87df
test: debugging auth
CS76 May 31, 2024
a5a5ed3
test: composer auth env setup
CS76 May 31, 2024
4387da4
fix: composer_auth var added
CS76 May 31, 2024
e6f5c95
test: composer auth malformed fix test
CS76 May 31, 2024
00aec98
fix: file path missing bug fix
CS76 May 31, 2024
d4c856c
fix: missing file in the path bug fix
CS76 May 31, 2024
dd8a692
fix: adding full path
CS76 May 31, 2024
b48fa4a
fix: missing index.css file bug fix
CS76 May 31, 2024
d394a55
fix: missing files bug fix
CS76 May 31, 2024
0535511
fix: tailwind config preset missing bug fix
CS76 May 31, 2024
0cd86e9
fix: import preset path fix
CS76 May 31, 2024
cddf6ce
fix: nginx docker fail bug fix
CS76 May 31, 2024
036eb3d
feat: landing page updates
CS76 May 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added .DS_Store
Binary file not shown.
4 changes: 3 additions & 1 deletion .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
push: true
build-args: |
RELEASE_VERSION=dev-app-latest
COMPOSER_AUTH=${{ secrets.COMPOSER_AUTH }}
tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:dev-app-latest

# Build and push the nginx Docker image
Expand All @@ -83,6 +84,7 @@ jobs:
push: true
build-args: |
RELEASE_VERSION=dev-nginx-latest
COMPOSER_AUTH=${{ secrets.COMPOSER_AUTH }}
tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:dev-nginx-latest

# Deploy the latest Docker image to the GKE cluster
Expand All @@ -92,4 +94,4 @@ jobs:
kubectl rollout restart deployment/$WORKER_DEPLOYMENT_NAME
kubectl rollout restart deployment/$SCHEDULER_DEPLOYMENT_NAME
kubectl rollout status deployment/$DEPLOYMENT_NAME --timeout=300s
kubectl get services -o wide
kubectl get services -o wide
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ yarn-error.log
/.fleet
/.idea
/.vscode
storage/*.tsv
storage/*.csv
104 changes: 104 additions & 0 deletions app/Console/Commands/AssignIdentifiers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?php

namespace App\Console\Commands;

use App\Models\Molecule;
use App\Models\Ticker;
use DB;
use Illuminate\Console\Command;

class AssignIdentifiers extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'molecules:assign-identifiers';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';

/**
* Execute the console command.
*/
public function handle()
{
$batchSize = 1000;
$currentIndex = $this->fetchLastIndex() + 1;
$data = [];
$this->info('Mapping parents');
Molecule::select('identifier', 'id', 'has_variants')->where([
['has_stereo', '=', false],
['identifier', '=', null],
])->chunk($batchSize, function ($molecules) use (&$currentIndex) {
$data = [];
$header = ['id', 'identifier'];
foreach ($molecules as $molecule) {
if (! $molecule->identifier) {
$data[] = array_combine($header, [$molecule->id, $this->generateIdentifier($currentIndex)]);
$currentIndex++;
}
}
$this->insertBatch($data);
});
$this->info('Mapping parents: Done');

$this->info('Mapping variants');
Molecule::select('identifier', 'id', 'has_variants')->where(
[
['is_parent', '=', true],
['identifier', '!=', null],
])->chunk($batchSize, function ($molecules) {
$data = [];
$header = ['id', 'identifier'];
foreach ($molecules as $molecule) {
$i = 1;
$variants = $molecule->variants;
foreach ($variants as $variant) {
$data[] = array_combine($header, [$variant->id, $molecule->identifier.'.'.$i]);
$i++;
}
}
$this->insertBatch($data);
});
$this->info('Mapping variants: Done');
}

public function generateIdentifier($index)
{
return 'CNP'.str_pad($index, 7, '0', STR_PAD_LEFT);
}

public function fetchLastIndex()
{
$ticker = Ticker::where('type', 'molecule')->first();

return (int) $ticker->index;
}

/**
* Insert a batch of data into the database.
*
* @return void
*/
private function insertBatch(array $data)
{
DB::transaction(function () use ($data) {
foreach ($data as $row) {
Molecule::updateorCreate(
[
'id' => $row['id'],
],
[
'identifier' => $row['identifier'],
]
);
}
});
}
}
189 changes: 189 additions & 0 deletions app/Console/Commands/DashWidgetsRefresh.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
<?php

namespace App\Console\Commands;

use App\Models\Collection;
use App\Models\GeoLocation;
use App\Models\Molecule;
use App\Models\Organism;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;

class DashWidgetsRefresh extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:cache';

/**
* The console command description.
*
* @var string
*/
protected $description = 'This refreshes the dashboard widgets.';

/**
* Execute the console command.
*/
public function handle()
{
// Clear the cache for all widgets
Cache::forget('stats');

// Create the cache for all DashboardStats widgets
Cache::rememberForever('stats.collections', function () {
return DB::table('collections')->selectRaw('count(*)')->get()[0]->count;
});
Cache::rememberForever('stats.citations', function () {
return DB::table('citations')->selectRaw('count(*)')->get()[0]->count;
});
Cache::rememberForever('stats.organisms', function () {
return DB::table('organisms')->selectRaw('count(*)')->get()[0]->count;
});
Cache::rememberForever('stats.geo_locations', function () {
return DB::table('geo_locations')->selectRaw('count(*)')->get()[0]->count;
});
Cache::rememberForever('stats.reports', function () {
return DB::table('reports')->selectRaw('count(*)')->get()[0]->count;
});

// Create the cache for all DashboardStatsMid widgets
Cache::rememberForever('stats.molecules', function () {
return DB::table('molecules')->selectRaw('count(*)')->get()[0]->count;
});
Cache::rememberForever('stats.molecules.non_stereo', function () {
return DB::table('molecules')->selectRaw('count(*)')->whereRaw('has_stereo=false and is_parent=false')->get()[0]->count;
});
Cache::rememberForever('stats.molecules.stereo', function () {
return DB::table('molecules')->selectRaw('count(*)')->whereRaw('has_stereo=true')->get()[0]->count;
});
Cache::rememberForever('stats.molecules.parent', function () {
return DB::table('molecules')->selectRaw('count(*)')->whereRaw('has_stereo=false and is_parent=true')->get()[0]->count;
});

// Create the cache for all Collection widgets

$collection_ids = Collection::pluck('id')->toArray();

foreach ($collection_ids as $collection_id) {

Cache::rememberForever('stats.collections'.$collection_id.'entries.count', function () use ($collection_id) {
return DB::table('entries')->selectRaw('count(*)')->whereRaw('collection_id='.$collection_id)->get()[0]->count;
});

Cache::rememberForever('stats.collections'.$collection_id.'passed_entries.count', function () use ($collection_id) {
return DB::table('entries')->selectRaw('count(*)')->whereRaw('collection_id='.$collection_id)->whereRaw("status = 'PASSED'")->get()[0]->count;
});

Cache::rememberForever('stats.collections'.$collection_id.'rejected_entries.count', function () use ($collection_id) {
return DB::table('entries')->selectRaw('count(*)')->whereRaw('collection_id='.$collection_id)->whereRaw("status = 'REJECTED'")->get()[0]->count;
});

Cache::rememberForever('stats.collections'.$collection_id.'citations.count', function () use ($collection_id) {
$entries = DB::table('entries')
->select('entries.doi')
->join('collections', 'collections.id', '=', 'entries.collection_id')
->where('collections.id', $collection_id)
->pluck('doi');

$dois = collect();

foreach ($entries as $entry) {
$dois = $dois->merge(explode('|', $entry));
}

$uniqueDois = $dois->filter(function ($doi) {
return ! empty($doi);
})->unique();

return $uniqueDois->count();
});

Cache::rememberForever('stats.collections'.$collection_id.'molecules.count', function () use ($collection_id) {
return DB::table('collection_molecule')->selectRaw('count(*)')->whereRaw('collection_id ='.$collection_id)->get()[0]->count;
});

Cache::rememberForever('stats.collections'.$collection_id.'organisms.count', function () use ($collection_id) {
$entries = DB::table('entries')
->select('entries.organism')
->join('collections', 'collections.id', '=', 'entries.collection_id')
->where('collections.id', $collection_id)
->pluck('organism');

$organisms = collect();

foreach ($entries as $entry) {
$organisms = $organisms->merge(explode('|', $entry));
}

$uniqueOrgs = $organisms->filter(function ($organism) {
return ! empty($organism);
})->unique();

return $uniqueOrgs->count();
});

Cache::rememberForever('stats.collections'.$collection_id.'geo_locations.count', function () use ($collection_id) {
$entries = DB::table('entries')
->select('entries.geo_location')
->join('collections', 'collections.id', '=', 'entries.collection_id')
->where('collections.id', $collection_id)
->pluck('geo_location');

$geo_locations = collect();

foreach ($entries as $entry) {
$geo_locations = $geo_locations->merge(explode('|', $entry));
}

$uniqueGeos = $geo_locations->filter(function ($geo_location) {
return ! empty($geo_location);
})->unique();

return $uniqueGeos->count();
});
}

// Create the cache for all Molecule widgets
// $molecule_ids = Molecule::pluck('id')->toArray();
// foreach ($molecule_ids as $molecule_id) {
// Cache::rememberForever('stats.molecules'.$molecule_id.'organisms.count', function () use ($molecule_id){
// return DB::table('molecule_organism')->selectRaw('count(*)')->whereRaw('molecule_id='.$molecule_id)->get()[0]->count;
// });
// Cache::rememberForever('stats.molecules'.$molecule_id.'geo_locations.count', function () use ($molecule_id){
// return DB::table('geo_location_molecule')->selectRaw('count(*)')->whereRaw('molecule_id='.$molecule_id)->get()[0]->count;
// });
// }

// // Create the cache for all Organism widgets

// $organism_ids = Organism::pluck('id')->toArray();

// foreach ($organism_ids as $organism_id) {
// Cache::rememberForever('stats.organisms'.$organism_id.'molecules.count', function () use ($organism_id){
// return DB::table('molecule_organism')->selectRaw('count(*)')->whereRaw('organism_id='.$organism_id)->get()[0]->count;
// });
// Cache::rememberForever('stats.organisms'.$organism_id.'geo_locations.count', function () use ($organism_id){
// return DB::table('molecule_organism')->selectRaw('count(*)')->whereRaw('organism_id='.$organism_id)->Join('geo_location_molecule', 'molecule_organism.molecule_id', '=', 'geo_location_molecule.molecule_id')->get()[0]->count;
// });
// }

// Create the cache for all Geo Location widgets

// $geo_location_ids = GeoLocation::pluck('id')->toArray();

// foreach ($geo_location_ids as $geo_location_id) {
// Cache::rememberForever('stats.geo_locations'.$geo_location_id.'molecules.count', function () use ($geo_location_id) {
// return DB::table('geo_location_molecule')->selectRaw('count(*)')->whereRaw('geo_location_id='.$geo_location_id)->get()[0]->count;
// });
// Cache::rememberForever('stats.geo_locations'.$geo_location_id.'organisms.count', function () use ($geo_location_id) {
// return DB::table('geo_location_molecule')->selectRaw('count(*)')->whereRaw('geo_location_id='.$geo_location_id)->Join('molecule_organism', 'geo_location_molecule.molecule_id', '=', 'molecule_organism.molecule_id')->get()[0]->count;
// });
// }

}
}
Loading