酒店预订平台
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.
 
 
 
 
 
 

82 lines
2.3 KiB

  1. <?php
  2. namespace app\admin\controller\example;
  3. use app\common\controller\Backend;
  4. /**
  5. * 表格联动
  6. * 点击左侧日志列表,右侧的表格数据会显示指定管理员的日志列表
  7. * @icon fa fa-table
  8. */
  9. class Tablelink extends Backend
  10. {
  11. protected $model = null;
  12. protected $noNeedRight = ['table1', 'table2'];
  13. public function _initialize()
  14. {
  15. parent::_initialize();
  16. $this->model = model('AdminLog');
  17. }
  18. public function table1()
  19. {
  20. $this->model = model('Admin');
  21. //设置过滤方法
  22. $this->request->filter(['strip_tags']);
  23. if ($this->request->isAjax()) {
  24. //如果发送的来源是Selectpage,则转发到Selectpage
  25. if ($this->request->request('keyField')) {
  26. return $this->selectpage();
  27. }
  28. list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  29. $total = $this->model
  30. ->where($where)
  31. ->order($sort, $order)
  32. ->count();
  33. $list = $this->model
  34. ->where($where)
  35. ->order($sort, $order)
  36. ->limit($offset, $limit)
  37. ->select();
  38. $result = array("total" => $total, "rows" => $list);
  39. return json($result);
  40. }
  41. return $this->view->fetch('index');
  42. }
  43. public function table2()
  44. {
  45. $this->model = model('AdminLog');
  46. //设置过滤方法
  47. $this->request->filter(['strip_tags']);
  48. if ($this->request->isAjax()) {
  49. //如果发送的来源是Selectpage,则转发到Selectpage
  50. if ($this->request->request('keyField')) {
  51. return $this->selectpage();
  52. }
  53. list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  54. $total = $this->model
  55. ->where($where)
  56. ->order($sort, $order)
  57. ->count();
  58. $list = $this->model
  59. ->where($where)
  60. ->order($sort, $order)
  61. ->limit($offset, $limit)
  62. ->select();
  63. $result = array("total" => $total, "rows" => $list);
  64. return json($result);
  65. }
  66. return $this->view->fetch('index');
  67. }
  68. }