6 changed files with 101 additions and 10 deletions
-
16app/Admin/Controllers/HomeController.php
-
15app/Admin/Metrics/Examples/Community/TotalAmount.php
-
33app/Admin/Metrics/Examples/ServiceCard/TotalMm.php
-
27app/Admin/Metrics/Examples/ServiceCard/TotalStore.php
-
2app/Admin/routes.php
-
18app/Models/LanzuMmInfo.php
@ -0,0 +1,33 @@ |
|||
<?php |
|||
|
|||
namespace App\Admin\Metrics\Examples\ServiceCard; |
|||
|
|||
|
|||
use App\Models\LanzuMmInfo; |
|||
use App\Models\LanzuMpInfo; |
|||
use Dcat\Admin\Widgets\Metrics\Card; |
|||
|
|||
class TotalMm extends Card |
|||
{ |
|||
protected function init() |
|||
{ |
|||
parent::init(); |
|||
$this->title = '市场经理数'; |
|||
|
|||
$this->content(LanzuMmInfo::getMmInfoCount()); |
|||
} |
|||
|
|||
/** |
|||
* 渲染卡片内容 |
|||
* @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; |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
|
|||
namespace App\Admin\Metrics\Examples\ServiceCard; |
|||
|
|||
|
|||
use Dcat\Admin\Widgets\Metrics\Card; |
|||
|
|||
class TotalStore extends Card |
|||
{ |
|||
protected function init() |
|||
{ |
|||
parent::init(); |
|||
$this->title = '商户数'; |
|||
$this->content(222); |
|||
} |
|||
|
|||
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; |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue