Browse Source

Merge branch 'qs_local_cs' into develop

master
lanzu_qsy 5 years ago
parent
commit
2191df38c9
  1. 2
      app/Admin/Controllers/HomeController.php
  2. 34
      app/Admin/Metrics/Examples/TotalCommunity.php

2
app/Admin/Controllers/HomeController.php

@ -88,7 +88,7 @@ class HomeController extends Controller
->description('欢迎回到懒族后台')
->body(function (Row $row) {
$row->column(4, function (Column $column) {
$column->row(new Community\TotalCommunity());
$column->row(new Examples\TotalCommunity());
});
$row->column(4, function (Column $column) {

34
app/Admin/Metrics/Examples/TotalCommunity.php

@ -0,0 +1,34 @@
<?php
namespace App\Admin\Metrics\Examples;
use App\Models\LanzuCsInfo;
use Dcat\Admin\Widgets\Metrics\Card;
class TotalCommunity extends Card
{
protected function init()
{
parent::init();
$this->title = '社区总数';
$this->content(LanzuCsInfo::count());
}
/**
* 渲染卡片内容.
*
* @return string
*/
public function renderContent()
{
$content = parent::renderContent();
return <<<HTML
<div class="d-flex justify-content-between align-items-center mt-1" style="margin-bottom: 2px">
<h2 class="ml-1 font-large-1">{$content}</h2>
</div>
HTML;
}
}
Loading…
Cancel
Save