链街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.

41 lines
863 B

5 years ago
5 years ago
5 years ago
  1. <?php
  2. namespace App\Admin\Metrics\Examples\Community;
  3. use App\Models\LanzuUserBalance;
  4. use Dcat\Admin\Widgets\Metrics\Card;
  5. class TotalAmount extends Card
  6. {
  7. protected $uid;
  8. protected $uType;
  9. public function __construct($uid, $uType)
  10. {
  11. $this->uid = $uid;
  12. $this->uType =$uType;
  13. parent::__construct('可提现金额(元)');
  14. }
  15. protected function init()
  16. {
  17. parent::init();
  18. $this->content(LanzuUserBalance::getBalance($this->uid, $this->uType));
  19. }
  20. /**
  21. * 渲染卡片内容
  22. * @return string
  23. */
  24. public function renderContent()
  25. {
  26. $content = parent::renderContent();
  27. return <<<HTML
  28. <div class="d-flex justify-content-between align-items-center mt-1" style="margin-bottom: 2px">
  29. <h2 class="ml-1 font-large-1">{$content}</h2>
  30. </div>
  31. HTML;
  32. }
  33. }