Serve dashboard stats from daily_stats and default visit list to today.
Stop live-scanning page_visits on every dashboard load (including today) so the admin home stays fast; keep the live path only for channel filters and cache the result for 45s. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,12 +4,12 @@ namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Concerns\PortalAware;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\DsChainLog;
|
||||
use App\Models\Device;
|
||||
use App\Models\DsChainLog;
|
||||
use App\Models\PageVisit;
|
||||
use App\Models\User;
|
||||
use App\Support\CfIpCountry;
|
||||
use App\Support\AgentScope;
|
||||
use App\Support\CfIpCountry;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -154,7 +154,7 @@ class PageVisitController extends Controller
|
||||
$q->where('referer', 'like', '%'.$referer.'%');
|
||||
}
|
||||
|
||||
[$from, $to] = $this->rangeBounds((string) $request->query('range', '30d'));
|
||||
[$from, $to] = $this->rangeBounds((string) $request->query('range', 'today'));
|
||||
$q->whereBetween('created_at', [$from, $to]);
|
||||
|
||||
return $q;
|
||||
|
||||
Reference in New Issue
Block a user