mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,6 +151,11 @@
|
||||
class=" select-markdown"
|
||||
href="#post-markdown"
|
||||
>选中markdown</a>
|
||||
<a
|
||||
class=""
|
||||
href="{:url('post/downloadMarkdown',['id'=>$post.id])}"
|
||||
target="_blank"
|
||||
>下载markdown</a>
|
||||
<hr>
|
||||
|
||||
<div class="post-platform-list">
|
||||
|
||||
Reference in New Issue
Block a user