正在显示
1 个修改的文件
包含
9 行增加
和
6 行删除
| @@ -98,14 +98,17 @@ class Review extends DoubleBase | @@ -98,14 +98,17 @@ class Review extends DoubleBase | ||
| 98 | return $this->selectpage(); | 98 | return $this->selectpage(); |
| 99 | } | 99 | } |
| 100 | list($where, $sort, $order, $offset, $limit) = $this->buildparams('review_name'); | 100 | list($where, $sort, $order, $offset, $limit) = $this->buildparams('review_name'); |
| 101 | + $map = []; | ||
| 102 | + if($this->auth->rule_type == 1) { | ||
| 101 | $map['manystore_id'] = $this->auth->id; | 103 | $map['manystore_id'] = $this->auth->id; |
| 102 | - $list = $this->model | ||
| 103 | - ->where($where) | ||
| 104 | - ->where($map) | 104 | + } |
| 105 | + $count = $this->model->where($where)->where($map)->count(); | ||
| 106 | + $list = $this->model->where($where)->where($map) | ||
| 105 | ->order($sort, $order) | 107 | ->order($sort, $order) |
| 106 | - ->paginate($limit); | ||
| 107 | - | ||
| 108 | - $result = array("total" => $list->total(), "rows" => $list->items()); | 108 | + ->limit($offset, $limit) |
| 109 | + ->fetchSql(true) | ||
| 110 | + ->select(); | ||
| 111 | + $result = array("total" => $count, "rows" => $list); | ||
| 109 | return json($result); | 112 | return json($result); |
| 110 | } | 113 | } |
| 111 | return $this->view->fetch(); | 114 | return $this->view->fetch(); |
-
请 注册 或 登录 后发表评论