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), ]); } /** * 卡片内容 * * @param string $content * * @return $this */ public function withContent($content) { return $this->content( <<

{$content['total_points']}

总积分

{$content['total_wallet']}

总可提

{$content['total_balance']}

总余额
HTML ); } /** * 卡片底部内容. * * @param string $new * @param string $open * @param string $response * * @return $this */ public function withFooter($new, $open, $response) { return $this->footer( <<

New Tickets

{$new}

Open Tickets

{$open}

Response Time

{$response}
HTML ); } }