fix: query
This commit is contained in:
@@ -254,6 +254,15 @@ class PluginSessionController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
$createdFrom = trim((string) $request->query('created_from', ''));
|
||||
$createdTo = trim((string) $request->query('created_to', ''));
|
||||
if ($createdFrom !== '' && preg_match('/^\d{4}-\d{2}-\d{2}/', $createdFrom)) {
|
||||
$q->whereDate('plugin_sessions.created_at', '>=', substr($createdFrom, 0, 10));
|
||||
}
|
||||
if ($createdTo !== '' && preg_match('/^\d{4}-\d{2}-\d{2}/', $createdTo)) {
|
||||
$q->whereDate('plugin_sessions.created_at', '<=', substr($createdTo, 0, 10));
|
||||
}
|
||||
|
||||
return $q;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user