调整首页用户统计图
parent
047f75e02d
commit
6eed51596f
|
|
@ -52,8 +52,14 @@ class Users extends Donut
|
|||
$nums = UserInfo::selectRaw('count(1) as num, agent_level')->groupBy('agent_level')->pluck('num', 'agent_level')->toArray();
|
||||
$this->withContent($nums);
|
||||
// dd($nums);
|
||||
foreach (UserInfo::$agentLevelRanks as $rank) {
|
||||
if (!isset($nums[$rank])) {
|
||||
$nums[$rank] = 0;
|
||||
}
|
||||
}
|
||||
// 图表数据
|
||||
$this->withChart(array_merge($nums, []));
|
||||
ksort($nums);
|
||||
$this->withChart($nums);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -65,8 +71,9 @@ class Users extends Donut
|
|||
*/
|
||||
public function withChart(array $data)
|
||||
{
|
||||
// dd($data);
|
||||
return $this->chart([
|
||||
'series' => $data,
|
||||
'series' => array_values($data),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue