File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
app/Http/Controllers/Admin Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -76,16 +76,12 @@ public function index(Request $request)
76
76
*/
77
77
protected function certificationCount ()
78
78
{
79
- $ counts = \DB ::select ('
80
- SELECT
81
- COUNT(status) AS `全部认证用户:`,
82
- COUNT(CASE WHEN status=0 THEN 1 ELSE NULL END ) AS `待审核用户:`,
83
- COUNT(CASE WHEN status=1 THEN 1 ELSE NULL END ) AS `已认证用户:`,
84
- COUNT(CASE WHEN status=2 THEN 1 ELSE NULL END ) AS `驳回用户:`
85
- FROM `certifications` '
86
- );
87
-
88
- return $ counts ;
79
+ return [
80
+ '全部认证用户: ' => Certification::count (),
81
+ '待审核用户: ' => Certification::where ('status ' , 0 )->count (),
82
+ '已认证用户: ' => Certification::where ('status ' , 1 )->count (),
83
+ '驳回用户: ' => Certification::where ('status ' , 2 )->count (),
84
+ ];
89
85
}
90
86
91
87
/**
You can’t perform that action at this time.
0 commit comments