title('统计预览'); $this->height(300); $this->contentWidth(12, 0); } /** * 处理请求 * * @param Request $request * * @return mixed|void */ public function handle(Request $request) { // 卡片内容 $this->withContent([ 'total_points'=> UserInfo::sum('points'), 'total_wallet'=> bcdiv(Wallet::sum('balance'), 100, 2), 'total_balance'=> bcdiv(Balance::sum('balance'), 100, 2), 'total_distribution'=> DistributionPreIncome::unsettlement()->sum('total_revenue'), 'total_quota_v2' => UserInfo::sum('quota_v2'), 'total_quota_v1' => UserInfo::sum('quota_v1'), ]); } /** * 卡片内容 * * @param string $content * * @return $this */ public function withContent($content) { return $this->content( <<
New Tickets
{$new}Open Tickets
{$open}Response Time
{$response}