mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-04 00:24:29 +08:00
feat: 增加markdown下载
This commit is contained in:
@@ -53,9 +53,9 @@ class Post extends Common
|
||||
->where('type', $this->request->param('type', 1))
|
||||
->order('id desc');
|
||||
|
||||
if($platform_status == 1){
|
||||
if ($platform_status == 1) {
|
||||
$model_list = $model_list->where('post_platform_status', 'like', "%,{$platform_type},%");
|
||||
}else if ($platform_status === '0'){
|
||||
} elseif ($platform_status === '0') {
|
||||
$model_list = $model_list->where('post_platform_status', 'not like', "%,{$platform_type},%");
|
||||
}
|
||||
|
||||
@@ -314,4 +314,12 @@ class Post extends Common
|
||||
|
||||
return json_message();
|
||||
}
|
||||
|
||||
public function downloadMarkdown($id)
|
||||
{
|
||||
$model_post = ModelPost::find($id);
|
||||
$mardkown = $model_post->content_markdown;
|
||||
|
||||
return download($mardkown, $model_post->title . '.md', true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user