Notice.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace core\dict;
  12. class Notice extends BaseDict
  13. {
  14. /**
  15. * 系统uniapp页面链接
  16. * @param array $data
  17. * @return array|mixed
  18. */
  19. public function load(array $data)
  20. {
  21. $template_files = [];
  22. $system_path = $this->getDictPath() . "notice" . DIRECTORY_SEPARATOR . $data[ 'type' ] . ".php";
  23. if (is_file($system_path)) {
  24. $template_files[] = $system_path;
  25. }
  26. $addons = $this->getLocalAddons();
  27. foreach ($addons as $v) {
  28. $template_path = $this->getAddonDictPath($v) . "notice" . DIRECTORY_SEPARATOR . $data[ 'type' ] . ".php";
  29. if (is_file($template_path)) {
  30. $template_files[] = $template_path;
  31. }
  32. }
  33. $template_files_data = $this->loadFiles($template_files);
  34. $template_data_array = [];
  35. foreach ($template_files_data as $file_data) {
  36. $template_data_array = empty($template_data_array) ? $file_data : array_merge($template_data_array, $file_data);
  37. }
  38. return $template_data_array;
  39. }
  40. }