修改文章分类的缓存

This commit is contained in:
augushong
2021-03-29 12:45:37 +08:00
parent a993db8781
commit 93be540b54
6 changed files with 22 additions and 4 deletions

View File

@@ -16,14 +16,14 @@ class Index extends Common
*
* @return \think\Response
*/
public function index($post_id = 0,$category_id = 0)
public function index($post_id = 0)
{
$list_post = Post::quickSelect();
if (empty($post_id)) {
$model_post = $list_post->first()->post->first();
} else {
$model_post = $list_post->where('id',$category_id)->column('post')[0]->where('id', $post_id)->first();
$model_post = Post::quickFind($post_id);
}
View::assign('model_post', $model_post);

View File

@@ -2,4 +2,4 @@
use think\facade\Route;
Route::rule('doc/[:category_id]/[:post_id]','Index/index');
Route::rule('doc/[:post_id]','Index/index');