no message

doctree
zcy 2023-01-08 12:23:30 +08:00
parent e1b158e086
commit a5f5360017
4 changed files with 18 additions and 15 deletions

View File

@ -108,7 +108,8 @@ class ArticleTree extends Controller
$redis->connect('127.0.0.1', 6379); $redis->connect('127.0.0.1', 6379);
//查看服务是否运行 //查看服务是否运行
$commentModel = new Models\DocComment(); $commentModel = new Models\DocComment();
$vertime = urldecode((string)$this->params[1]); if(sizeof($this->params) > 1)
$vertime = urldecode((string)$this->params[1]);
$doccoment = $commentModel->DocComments((int)$this->params[0]); $doccoment = $commentModel->DocComments((int)$this->params[0]);
if(sizeof($this->params) > 0){ if(sizeof($this->params) > 0){
@ -121,25 +122,28 @@ class ArticleTree extends Controller
$firstpagedocs = []; $firstpagedocs = [];
$child_docs = $docModel->getChildrenDocs($this->params[0]); $child_docs = $docModel->getChildrenDocs($this->params[0]);
$doc = []; $doc = [];
if($vertime != ""){ if(sizeof($this->params) > 1){
$doc = $docModel->docHistoryTree((int)$this->params[0],$vertime); if(\strstr($vertime,"20") == 0){
$doc = array_merge($doc,$child_docs);
$doc = $docModel->docHistoryTree((int)$this->params[0],$vertime);
$doc = array_merge($doc,$child_docs);
}else{
$doc = $docModel->docTree((int)$this->params[0]);
$doc = array_merge($doc,$child_docs);
}
}else{ }else{
$doc = $docModel->docTree((int)$this->params[0]); $doc = $docModel->docTree((int)$this->params[0]);
$doc = array_merge($doc,$child_docs); $doc = array_merge($doc,$child_docs);
} }
$top5 = $docModel->top5Doc(); $top5 = $docModel->top5Doc();
$markdowntoc = new \ParsedownToC(); $markdowntoc = new \ParsedownToC();
$doc[0]['content'] = $markdowntoc->body($doc[0]['content']); $doc[0]['content'] = $markdowntoc->body($doc[0]['content']);
$doc[0]['toc'] = $markdowntoc->contentsList(); $doc[0]['toc'] = $markdowntoc->contentsList();
// $doc_history = $docModel->doc_history((int)$this->params[0]); // $doc_history = $docModel->doc_history((int)$this->params[0]);
if($vertime == ""){
}else{
}
$markdown = new Parsedown; $markdown = new Parsedown;
foreach ($doc as $key => $value) { foreach ($doc as $key => $value) {

View File

@ -201,7 +201,7 @@ class Doc extends Model
'name' => $value['title'], 'name' => $value['title'],
'id' =>$value['id'], 'id' =>$value['id'],
'isParent'=> false, 'isParent'=> false,
'url' => \App\Config::Url() . "ArticleTree/article/" . $value['id']."/".$value['title'], 'url' => \App\Config::Url() . "ArticleTree/article/" . $value['id'],
'father' => (int)$value['father'], 'father' => (int)$value['father'],
'level' => $value['level'] 'level' => $value['level']
); );
@ -211,7 +211,7 @@ class Doc extends Model
'name' => $value['title'], 'name' => $value['title'],
'id' =>$value['id'], 'id' =>$value['id'],
'isParent'=> false, 'isParent'=> false,
'url' => \App\Config::Url() . "ArticleTree/article/" . $value['id']."/".$value['title'], 'url' => \App\Config::Url() . "ArticleTree/article/" . $value['id'],
'father' => (int)$value['father'], 'father' => (int)$value['father'],
'level' => $value['level'], 'level' => $value['level'],
'open' => true 'open' => true
@ -220,7 +220,6 @@ class Doc extends Model
if($opendocid == $value['father']) if($opendocid == $value['father'])
$tmp['open'] = true; $tmp['open'] = true;
$mapforbuildtree[$value['id']] = $tmp; $mapforbuildtree[$value['id']] = $tmp;
} }
for($i = $max_level;$i >= 0;$i --){ for($i = $max_level;$i >= 0;$i --){
foreach ($doc_all as $key => $value){ foreach ($doc_all as $key => $value){

View File

@ -82,7 +82,7 @@
最新文章 最新文章
</a> </a>
{% for doc in topdoc %} {% for doc in topdoc %}
<a href="{{ url }}ArticleTree/article/{{ doc.id }}/{{ doc.title }}" class="list-group-item">{{doc.title}}</a> <a href="{{ url }}ArticleTree/article/{{ doc.id }}/" class="list-group-item">{{doc.title}}</a>
{% endfor %} {% endfor %}
</div> </div>
@ -217,7 +217,7 @@ function expandNode(e) {
<select NAME="TEMP" onchange="location = this.value;" style="font-size: 20px ; background: #1d5987;color: white;margin-left: 15px; "> <select NAME="TEMP" onchange="location = this.value;" style="font-size: 20px ; background: #1d5987;color: white;margin-left: 15px; ">
<option value></option> <option value></option>
{% for vertime in vestimes %} {% for vertime in vestimes %}
<option value="{{vertime.edit_time}}" > <option value="{{ url }}ArticleTree/article/{{ doc.id }}/{{vertime.edit_time}}" >
{{vertime.edit_time}} {{vertime.edit_time}}
</option> </option>
{% endfor %} {% endfor %}

View File

@ -95,7 +95,7 @@ function expandNode(e) {
最新文章 最新文章
</a> </a>
{% for doc in topdoc %} {% for doc in topdoc %}
<a href="{{ url }}ArticleTree/article/{{ doc.id }}/{{ doc.title }}" class="list-group-item">{{doc.title}}</a> <a href="{{ url }}ArticleTree/article/{{ doc.id }}/" class="list-group-item">{{doc.title}}</a>
{% endfor %} {% endfor %}
</div> </div>
{% endblock %} {% endblock %}