Diy.php 843 B

1234567891011121314151617181920212223242526272829
  1. <?php namespace Manage\Api\Page;
  2. use Dever;
  3. use Manage\Lib\Page;
  4. # 自定义页面
  5. class Diy extends Page
  6. {
  7. public function __construct($load = '', $input = true, $id = false)
  8. {
  9. parent::__construct('diy', $load, $input);
  10. }
  11. public function get()
  12. {
  13. $this->checkFunc();
  14. if (is_string($this->config)) {
  15. $data = Dever::call($this->config, [$this]);
  16. } else {
  17. $data = $this->config;
  18. }
  19. $where = $this->config['where'] ?? [];
  20. if (isset($data['search'])) {
  21. $data['search'] = $this->search($where);
  22. $data['search']['type'] = 'search';
  23. }
  24. if (isset($data['data']) && $data['data']) {
  25. $data = Dever::call($data['data'], [$where, $data]);
  26. }
  27. return $data;
  28. }
  29. }