链街Dcat后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

44 lines
1.1 KiB

<?php
namespace App\Admin\Metrics\Examples\ServiceCard;
use App\Models\ImsCjdcStore;
use App\Models\LanzuMmInfo;
use App\Models\LanzuStore;
use Dcat\Admin\Admin;
use Dcat\Admin\Widgets\Metrics\Card;
class TotalStore extends Card
{
protected function init()
{
parent::init();
$this->title = '商户数';
$aud = Admin::user();
$count = 0;
if ($aud->isRole('lanzu_mm')){
$mm = LanzuMmInfo::where('admin_user_id',$aud->id)->first();
if ($mm){
$count = ImsCjdcStore::where('mm_user_id',$mm->user_id)->count();
}
}elseif($aud->isRole('lanzu_mp')){
$count = ImsCjdcStore::count();
}else{
$count = ImsCjdcStore::count();
}
$this->content($count);
}
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;
}
}