AdminInfo.php 850 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace App\Module\System\AdminLazyRenderable;
  3. use App\Module\System\Models\AdminUser;
  4. use Dcat\Admin\Layout\Row;
  5. use Dcat\Admin\Models\Administrator;
  6. use Dcat\Admin\Widgets\Table;
  7. use UCore\DcatAdmin\Support\LazyRenderable;
  8. class AdminInfo extends LazyRenderable
  9. {
  10. public function index($admin_id)
  11. {
  12. $content = '';
  13. $row = new Row();
  14. $content .= $row->render();
  15. $admin = AdminUser::query()->find($admin_id);
  16. $infoArray=[];
  17. $infoArray['username'] =$admin->username;
  18. $content .= Table::make($infoArray);
  19. return view('admin_core.admin_info', [
  20. 'admin_id' => $admin_id,
  21. 'content' => $content
  22. ]);
  23. }
  24. public function render()
  25. {
  26. $admin_id = $this->admin_id;
  27. return $this->index($admin_id);
  28. }
  29. }