123456789101112131415161718192021222324252627282930 |
- /**
- * 查看
- */
- public function index()
- {
- //当前是否为关联查询
- $this->relationSearch = {%relationSearch%};
-
- if ($this->request->isAjax())
- {
- list($where, $sort, $order, $offset, $limit) = $this->buildparams();
- $total = $this->model
- {%relationWith%}
- ->where($where)
- ->order($sort, $order)
- ->count();
- $list = $this->model
- {%relationWith%}
- ->where($where)
- ->order($sort, $order)
- ->limit($offset, $limit)
- ->select();
- $result = array("total" => $total, "rows" => $list);
- return json($result);
- }
- return $this->view->fetch();
- }
|