Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a255180a4d
|
||
|
|
af09da8782
|
||
|
|
ddfea0530d
|
||
|
|
9d7d19899d
|
No files matched your search
@@ -109,7 +109,7 @@ class PlaceRepository
|
|||||||
// count the places never visited
|
// count the places never visited
|
||||||
$selectUnvisited = new Select(\Container::$dbConnection, 'places');
|
$selectUnvisited = new Select(\Container::$dbConnection, 'places');
|
||||||
$selectUnvisited->leftJoin($selectPlacesByCurrentUser, ['places', 'id'], '=', ['places_by_current_user', 'place_id']);
|
$selectUnvisited->leftJoin($selectPlacesByCurrentUser, ['places', 'id'], '=', ['places_by_current_user', 'place_id']);
|
||||||
$selectUnvisited->where('map_id', '=', $mapId);
|
$selectUnvisited->where(['places', 'map_id'], '=', $mapId);
|
||||||
$selectUnvisited->where(['places_by_current_user', 'last_time'], '=', null);
|
$selectUnvisited->where(['places_by_current_user', 'last_time'], '=', null);
|
||||||
$numberOfUnvisitedPlaces = $selectUnvisited->count();
|
$numberOfUnvisitedPlaces = $selectUnvisited->count();
|
||||||
|
|
||||||
@@ -140,11 +140,11 @@ class PlaceRepository
|
|||||||
// count places that were visited at least once
|
// count places that were visited at least once
|
||||||
$selectOldPlaces = new Select(\Container::$dbConnection, 'places');
|
$selectOldPlaces = new Select(\Container::$dbConnection, 'places');
|
||||||
$selectOldPlaces->innerJoin($selectPlacesByCurrentUser, ['places', 'id'], '=', ['places_by_current_user', 'place_id']);
|
$selectOldPlaces->innerJoin($selectPlacesByCurrentUser, ['places', 'id'], '=', ['places_by_current_user', 'place_id']);
|
||||||
$selectOldPlaces->where('map_id', '=', $mapId);
|
$selectOldPlaces->where(['places', 'map_id'], '=', $mapId);
|
||||||
$numberOfOldPlaces = $selectOldPlaces->count();
|
$numberOfOldPlaces = $selectOldPlaces->count();
|
||||||
|
|
||||||
// set order by datetime, oldest first
|
// set order by datetime, oldest first
|
||||||
$selectOldPlaces->orderBy('last_time');
|
$selectOldPlaces->orderBy(['places_by_current_user', 'last_time']);
|
||||||
|
|
||||||
// selection algorithm with preference (weighting) for older places using Box-Muller transform
|
// selection algorithm with preference (weighting) for older places using Box-Muller transform
|
||||||
$pickGaussianRandomInt = function($numberOfPlaces) {
|
$pickGaussianRandomInt = function($numberOfPlaces) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<div class="box">
|
<div class="box">
|
||||||
<form id="loginForm" action="/login" method="post" data-redirect-on-success="<?= $redirectUrl ?>">
|
<form id="loginForm" action="/login" method="post" data-redirect-on-success="<?= $redirectUrl ?>">
|
||||||
<input type="email" class="text big fullWidth" name="email" placeholder="Email address" autocomplete="username" required autofocus>
|
<input type="email" class="text big fullWidth" name="email" placeholder="Email address" autocomplete="username" required autofocus>
|
||||||
<input type="password" class="text big fullWidth marginTop" name="password" placeholder="Password autocomplete="current-password"" required minlength="6">
|
<input type="password" class="text big fullWidth marginTop" name="password" placeholder="Password" autocomplete="current-password" required minlength="6">
|
||||||
<p id="loginFormError" class="formError justify marginTop"></p>
|
<p id="loginFormError" class="formError justify marginTop"></p>
|
||||||
<div class="right marginTop">
|
<div class="right marginTop">
|
||||||
<button type="submit">Login</button>
|
<button type="submit">Login</button>
|
||||||
|
|||||||
Reference in new issue
Block a user