no message
parent
e1b158e086
commit
a5f5360017
|
@ -108,6 +108,7 @@ class ArticleTree extends Controller
|
|||
$redis->connect('127.0.0.1', 6379);
|
||||
//查看服务是否运行
|
||||
$commentModel = new Models\DocComment();
|
||||
if(sizeof($this->params) > 1)
|
||||
$vertime = urldecode((string)$this->params[1]);
|
||||
|
||||
$doccoment = $commentModel->DocComments((int)$this->params[0]);
|
||||
|
@ -121,7 +122,9 @@ class ArticleTree extends Controller
|
|||
$firstpagedocs = [];
|
||||
$child_docs = $docModel->getChildrenDocs($this->params[0]);
|
||||
$doc = [];
|
||||
if($vertime != ""){
|
||||
if(sizeof($this->params) > 1){
|
||||
if(\strstr($vertime,"20") == 0){
|
||||
|
||||
$doc = $docModel->docHistoryTree((int)$this->params[0],$vertime);
|
||||
$doc = array_merge($doc,$child_docs);
|
||||
|
||||
|
@ -129,17 +132,18 @@ class ArticleTree extends Controller
|
|||
$doc = $docModel->docTree((int)$this->params[0]);
|
||||
$doc = array_merge($doc,$child_docs);
|
||||
}
|
||||
}else{
|
||||
$doc = $docModel->docTree((int)$this->params[0]);
|
||||
$doc = array_merge($doc,$child_docs);
|
||||
}
|
||||
|
||||
$top5 = $docModel->top5Doc();
|
||||
|
||||
$markdowntoc = new \ParsedownToC();
|
||||
$doc[0]['content'] = $markdowntoc->body($doc[0]['content']);
|
||||
$doc[0]['toc'] = $markdowntoc->contentsList();
|
||||
// $doc_history = $docModel->doc_history((int)$this->params[0]);
|
||||
if($vertime == ""){
|
||||
|
||||
}else{
|
||||
|
||||
}
|
||||
|
||||
$markdown = new Parsedown;
|
||||
foreach ($doc as $key => $value) {
|
||||
|
|
|
@ -201,7 +201,7 @@ class Doc extends Model
|
|||
'name' => $value['title'],
|
||||
'id' =>$value['id'],
|
||||
'isParent'=> false,
|
||||
'url' => \App\Config::Url() . "ArticleTree/article/" . $value['id']."/".$value['title'],
|
||||
'url' => \App\Config::Url() . "ArticleTree/article/" . $value['id'],
|
||||
'father' => (int)$value['father'],
|
||||
'level' => $value['level']
|
||||
);
|
||||
|
@ -211,7 +211,7 @@ class Doc extends Model
|
|||
'name' => $value['title'],
|
||||
'id' =>$value['id'],
|
||||
'isParent'=> false,
|
||||
'url' => \App\Config::Url() . "ArticleTree/article/" . $value['id']."/".$value['title'],
|
||||
'url' => \App\Config::Url() . "ArticleTree/article/" . $value['id'],
|
||||
'father' => (int)$value['father'],
|
||||
'level' => $value['level'],
|
||||
'open' => true
|
||||
|
@ -220,7 +220,6 @@ class Doc extends Model
|
|||
if($opendocid == $value['father'])
|
||||
$tmp['open'] = true;
|
||||
$mapforbuildtree[$value['id']] = $tmp;
|
||||
|
||||
}
|
||||
for($i = $max_level;$i >= 0;$i --){
|
||||
foreach ($doc_all as $key => $value){
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
最新文章
|
||||
</a>
|
||||
{% 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 %}
|
||||
</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; ">
|
||||
<option value></option>
|
||||
{% for vertime in vestimes %}
|
||||
<option value="{{vertime.edit_time}}" >
|
||||
<option value="{{ url }}ArticleTree/article/{{ doc.id }}/{{vertime.edit_time}}" >
|
||||
{{vertime.edit_time}}
|
||||
</option>
|
||||
{% endfor %}
|
||||
|
|
|
@ -95,7 +95,7 @@ function expandNode(e) {
|
|||
最新文章
|
||||
</a>
|
||||
{% 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 %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue