fix: BlogStats 浏览量 number_format 显式转 float(MySQL SUM 返回 string,strict_types 下 TypeError)
This commit is contained in:
@@ -19,7 +19,7 @@ class BlogStats extends BaseWidget
|
||||
{
|
||||
return [
|
||||
Stat::make('文章', Post::published()->count())
|
||||
->description('总浏览量 '.number_format(Post::sum('views')))
|
||||
->description('总浏览量 '.number_format((float) Post::sum('views')))
|
||||
->icon('heroicon-o-document-text'),
|
||||
Stat::make('评论', Comment::query()->where('status', 'published')->count())
|
||||
->description('待审核 '.Comment::query()->where('status', 'pending')->count())
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
fake-jpg
|
||||
+1
@@ -0,0 +1 @@
|
||||
fake-jpg
|
||||
+1
@@ -0,0 +1 @@
|
||||
fake-jpg
|
||||
+1
@@ -0,0 +1 @@
|
||||
fake-jpg
|
||||
+1
@@ -0,0 +1 @@
|
||||
fake-jpg
|
||||
+1
@@ -0,0 +1 @@
|
||||
fake-jpg
|
||||
+1
@@ -0,0 +1 @@
|
||||
fake-jpg
|
||||
+1
@@ -0,0 +1 @@
|
||||
fake-jpg
|
||||
+1
@@ -0,0 +1 @@
|
||||
fake-jpg
|
||||
+1
@@ -0,0 +1 @@
|
||||
fake-jpg
|
||||
Reference in New Issue
Block a user