title('统计预览'); $this->height(320); $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( <<

{$content['total_distribution']}

当前预收益

{$content['total_wallet']}

总可提

{$content['total_balance']}

总余额

{$content['total_points']}

总积分

{$content['total_quota_v2']}

新配额

{$content['total_quota_v1']}

老配额
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 ); } }