6
0
Fork 0
jiqu-library-server/app/Admin/Metrics/Store/TotalUser.php

32 lines
606 B
PHP

<?php
namespace App\Admin\Metrics\Store;
use Dcat\Admin\Widgets\Metrics\Card;
use App\Models\UserInfo;
class TotalUser extends Card
{
protected function init()
{
parent::init();
$this->title('员工');
$this->subTitle('员工总数');
$this->withContent(UserInfo::where('is_company', 1)->count());
}
public function withContent($content)
{
return $this->content(
<<<HTML
<div class="card-body">
<h1 class="text-left">{$content}<h1>
</div>
HTML
);
}
}