diff --git a/app/common/model/Document.php b/app/common/model/Document.php index e6cf180..fc0f4c3 100644 --- a/app/common/model/Document.php +++ b/app/common/model/Document.php @@ -29,6 +29,7 @@ class Document extends BaseModel { $model = new self; $count = self::counts($model); + $model = $model->order("sort desc")->order("id desc"); if ($where['page'] && $where['limit']) $model = $model->page((int)$where['page'], (int)$where['limit']); $data = $model->select(); if ($data) $data = $data->toArray(); diff --git a/app/index/common.php b/app/index/common.php index a796c79..d59e6c9 100644 --- a/app/index/common.php +++ b/app/index/common.php @@ -420,9 +420,9 @@ function get_route_query() function make_category_url($item) { if ((int)$item['type'] == 0) { - return url('article/lists?id=' . $item['id'])->build(); + return url('article/lists', ['id'=>$item['alias']?:$item['id']])->build(); } elseif ((int)$item['type'] == 1) { - return url('article/lists?id=' . $item['id'])->build(); + return url('article/lists', ['id'=>$item['alias']?:$item['id']])->build(); } elseif ((int)$item['type'] == 2) { return $item['link_str']; } @@ -440,7 +440,7 @@ function make_detail_url($item) if ($item['link_str']) { return $item['link_str']; } else { - return url('article/detail?id=' . $item['alias']?:$item['id'])->build(); + return url('article/detail', ['id'=>$item['alias']?:$item['id']])->build(); } }