Data.php 712 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace DeverService\Manage;
  3. use Dever;
  4. use Dever\Data\Service;
  5. class Data extends Service
  6. {
  7. /**
  8. * 入口
  9. *
  10. * @return mixed
  11. */
  12. public function handle()
  13. {
  14. $data = $this->data();
  15. //Dever::export($data);die;
  16. //Dever::debug($data);die;
  17. return $data;
  18. }
  19. /**
  20. * 写sql
  21. *
  22. * @return mixed
  23. */
  24. private function data()
  25. {
  26. # 同时支持两种形式
  27. //return Dever::load('manage/admin-all');
  28. //return $this->query('select id from 3158_manage_admin where id=:0', array(':0' => 1))->fetchAll();//fetch取单个
  29. //获取批量数据,并且获取分页
  30. $page['num'] = 2;
  31. return $this->all('select * FROM 3158_manage_menu', array(), $page);
  32. }
  33. }