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

36 lines
791 B

  1. <?php
  2. namespace App\admin\Card\Community;
  3. use App\Models\LanzuUserRelationBind;
  4. use Dcat\Admin\Admin;
  5. use Dcat\Admin\Widgets\Metrics\Card;
  6. class TotalUser extends Card
  7. {
  8. protected function init()
  9. {
  10. parent::init();
  11. $this->title = '绑定用户数';
  12. $adu = Admin::user();
  13. if ($adu->isRole('lanzu_cs')){
  14. $this->content(LanzuUserRelationBind::getCount($adu->id));
  15. }else{
  16. $this->content(LanzuUserRelationBind::getCount());
  17. }
  18. }
  19. public function renderContent()
  20. {
  21. $content = parent::renderContent();
  22. return <<<HTML
  23. <div class="d-flex justify-content-between align-items-center mt-1" style="margin-bottom: 2px">
  24. <h2 class="ml-1 font-large-1">{$content}</h2>
  25. </div>
  26. HTML;
  27. }
  28. }