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.
54 lines
1.4 KiB
54 lines
1.4 KiB
<?php
|
|
|
|
namespace App\Admin\Metrics\Examples\Community;
|
|
|
|
use App\Models\LanzuUserBalance;
|
|
use Dcat\Admin\Admin;
|
|
use Dcat\Admin\Support\Helper;
|
|
use Dcat\Admin\Widgets\Metrics\Card;
|
|
|
|
class TotalAmount extends Card
|
|
{
|
|
protected $uid;
|
|
protected $uType;
|
|
|
|
public function __construct($uid, $uType)
|
|
{
|
|
$this->uid = $uid;
|
|
$this->uType =$uType;
|
|
parent::__construct('可提现金额(元)');
|
|
}
|
|
|
|
protected function init()
|
|
{
|
|
parent::init();
|
|
$this->content(LanzuUserBalance::getBalance($this->uid, $this->uType));
|
|
}
|
|
|
|
/**
|
|
* 渲染卡片内容
|
|
* @return string
|
|
*/
|
|
public function renderContent()
|
|
{
|
|
|
|
$content = parent::renderContent();
|
|
$adu = Admin::user();
|
|
$url = "";
|
|
if ($adu->isRole('lanzu_mp')){
|
|
$url = url('admin/mp_withdraw/create');
|
|
}elseif ($adu->isRole('lanzu_cs')){
|
|
$url = url('admin/cs_withdraw/create');
|
|
}elseif ($adu->isRole('lanzu_mm')){
|
|
$url = url('admin/mm_withdraw/create');
|
|
}
|
|
return <<<HTML
|
|
<div class="d-flex justify-content-between bg-primary align-items-center mt-1" style="margin-bottom: 2px">
|
|
<h2 class="ml-1 font-large-1">{$content}</h2>
|
|
</div>
|
|
|
|
<a type="button" href="{$url}" style="float: right; margin-right: 10px;margin-top: 15px" class="btn btn-outline-primary">提现</a>
|
|
HTML;
|
|
}
|
|
|
|
}
|