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))
|
->where('type', $this->request->param('type', 1))
|
||||||
->order('id desc');
|
->order('id desc');
|
||||||
|
|
||||||
if($platform_status == 1){
|
if ($platform_status == 1) {
|
||||||
$model_list = $model_list->where('post_platform_status', 'like', "%,{$platform_type},%");
|
$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},%");
|
$model_list = $model_list->where('post_platform_status', 'not like', "%,{$platform_type},%");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -314,4 +314,12 @@ class Post extends Common
|
|||||||
|
|
||||||
return json_message();
|
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"
|
class=" select-markdown"
|
||||||
href="#post-markdown"
|
href="#post-markdown"
|
||||||
>选中markdown</a>
|
>选中markdown</a>
|
||||||
|
<a
|
||||||
|
class=""
|
||||||
|
href="{:url('post/downloadMarkdown',['id'=>$post.id])}"
|
||||||
|
target="_blank"
|
||||||
|
>下载markdown</a>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<div class="post-platform-list">
|
<div class="post-platform-list">
|
||||||
|
|||||||
Reference in New Issue
Block a user