32 lines
645 B
PHP
32 lines
645 B
PHP
<?php
|
|
|
|
namespace App\Admin\Metrics\Store;
|
|
|
|
use Dcat\Admin\Widgets\Metrics\Card;
|
|
use App\Models\Order;
|
|
|
|
class TotalOrder extends Card
|
|
{
|
|
protected function init()
|
|
{
|
|
parent::init();
|
|
|
|
$this->title('订单');
|
|
$this->subTitle('订单总数');
|
|
|
|
$this->withContent(Order::whereNotNull('store_id')->where('status', Order::STATUS_COMPLETED)->count());
|
|
}
|
|
|
|
public function withContent($content)
|
|
{
|
|
return $this->content(
|
|
<<<HTML
|
|
<div class="card-body">
|
|
<h1 class="text-left">{$content}<h1>
|
|
</div>
|
|
HTML
|
|
);
|
|
}
|
|
|
|
}
|