mirror of
https://github.com/v2board/v2board.git
synced 2025-02-11 07:59:11 +08:00
update: fix stat
This commit is contained in:
parent
14579d1eea
commit
a365357770
@ -42,8 +42,8 @@ class V2boardStatistics extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$this->statOrder();
|
$this->statOrder();
|
||||||
$this->statServer();
|
$this->statServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function statOrder()
|
private function statOrder()
|
||||||
@ -78,14 +78,16 @@ class V2boardStatistics extends Command
|
|||||||
|
|
||||||
private function statServer()
|
private function statServer()
|
||||||
{
|
{
|
||||||
$startAt = strtotime(date('Y-m-d'));
|
$endAt = strtotime(date('Y-m-d'));
|
||||||
|
$startAt = strtotime('-1 day', $endAt);
|
||||||
$statistics = ServerLog::select([
|
$statistics = ServerLog::select([
|
||||||
'server_id',
|
'server_id',
|
||||||
'method as server_type',
|
'method as server_type',
|
||||||
DB::raw("sum(u) as u"),
|
DB::raw("sum(u) as u"),
|
||||||
DB::raw("sum(d) as d"),
|
DB::raw("sum(d) as d"),
|
||||||
])
|
])
|
||||||
->where('log_at', $startAt)
|
->where('log_at', '>=', $startAt)
|
||||||
|
->where('log_at', '<', $endAt)
|
||||||
->groupBy('server_id', 'method')
|
->groupBy('server_id', 'method')
|
||||||
->get()
|
->get()
|
||||||
->toArray();
|
->toArray();
|
||||||
|
Loading…
Reference in New Issue
Block a user