Compare commits
26 Commits
601403bf3e
...
ozq-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d8e22d270 | ||
|
|
f154f3ddf6 | ||
|
|
2073a27ef7 | ||
|
|
e301fc7e94 | ||
|
|
f9251d944e | ||
|
|
1e6187801d | ||
|
|
346dcebba3 | ||
| ab7b23e5d1 | |||
| 325221bd67 | |||
|
|
721e91dc31 | ||
|
|
12e51c6f46 | ||
|
|
8ba9006173 | ||
|
|
a7d413871b | ||
|
|
ce6a882c17 | ||
|
|
7e7cfeacbc | ||
|
|
e1961d2a83 | ||
|
|
d313617e2b | ||
|
|
f0c82c848f | ||
|
|
f606dc64a5 | ||
|
|
39dc3c4e1a | ||
|
|
52b265f36e | ||
|
|
5f9fb74696 | ||
|
|
b251c78b2f | ||
|
|
2e1c83d46d | ||
|
|
0265cb0629 | ||
|
|
68d66b2925 |
@@ -192,6 +192,8 @@ class TopicNas extends Common
|
|||||||
{
|
{
|
||||||
// 获取文章分类及文章数据
|
// 获取文章分类及文章数据
|
||||||
$parent = ArticleCategoryModel::uniqueLabel('CATEGORY_681182e0a4529')->language($this->lang_id)->value('id');
|
$parent = ArticleCategoryModel::uniqueLabel('CATEGORY_681182e0a4529')->language($this->lang_id)->value('id');
|
||||||
|
$parent_two = ArticleCategoryModel::parent($parent)->language($this->lang_id)->column('id');//二级分类id
|
||||||
|
array_push($parent_two,$parent);
|
||||||
$article_categorys = ArticleCategoryModel::with(['article' => function($query) {
|
$article_categorys = ArticleCategoryModel::with(['article' => function($query) {
|
||||||
$query->field(['id', 'title', 'category_id'])
|
$query->field(['id', 'title', 'category_id'])
|
||||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
->order(['sort' => 'asc', 'id' => 'desc'])
|
||||||
@@ -199,15 +201,48 @@ class TopicNas extends Common
|
|||||||
}])
|
}])
|
||||||
->field([
|
->field([
|
||||||
'id',
|
'id',
|
||||||
|
'pid',
|
||||||
'name',
|
'name',
|
||||||
'icon'
|
'icon'
|
||||||
])
|
])
|
||||||
->language($this->lang_id)
|
->language($this->lang_id)
|
||||||
->parent($parent)
|
// ->parent($parent)
|
||||||
|
->parentChild($parent_two)
|
||||||
->isShow(true)
|
->isShow(true)
|
||||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
->order(['sort' => 'asc', 'id' => 'desc'])
|
||||||
->select();
|
->select();
|
||||||
View::assign('article_categorys', $article_categorys);
|
//查询三级分类
|
||||||
|
$article_categorys_new = [];
|
||||||
|
$article_categorys_two = [];
|
||||||
|
// dump($article_categorys->toArray());exit;
|
||||||
|
if (!$article_categorys->isEmpty()) {
|
||||||
|
foreach ($article_categorys->toArray() as $kk=>$vv) {
|
||||||
|
if ( $parent == $vv['pid'] ) {
|
||||||
|
array_push($article_categorys_new,$vv);
|
||||||
|
} else {
|
||||||
|
$article_categorys_two[$vv['pid']][] = $vv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !empty($article_categorys_two) ) {
|
||||||
|
foreach ($article_categorys_new as &$vvv) {
|
||||||
|
$articles = $vvv['article'];
|
||||||
|
if ( isset($article_categorys_two[$vvv['id']]) ) {
|
||||||
|
foreach ($article_categorys_two[$vvv['id']] as $v) {
|
||||||
|
foreach ($v['article'] as $av) {
|
||||||
|
if ( count($articles) < 3 ) {
|
||||||
|
array_push($articles,$av);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$vvv['article'] = $articles;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
View::assign('article_categorys', $article_categorys_new);
|
||||||
|
// View::assign('article_categorys', $article_categorys);
|
||||||
|
|
||||||
$contacts = [];
|
$contacts = [];
|
||||||
// 获取banner数据
|
// 获取banner数据
|
||||||
@@ -270,6 +305,7 @@ class TopicNas extends Common
|
|||||||
if (!$article_categorys->isEmpty()) {
|
if (!$article_categorys->isEmpty()) {
|
||||||
foreach ($article_categorys->toArray() as $kk=>$vv) {
|
foreach ($article_categorys->toArray() as $kk=>$vv) {
|
||||||
if ( $parent == $vv['pid'] ) {
|
if ( $parent == $vv['pid'] ) {
|
||||||
|
$vv['child'] = '';
|
||||||
array_push($article_categorys_new,$vv);
|
array_push($article_categorys_new,$vv);
|
||||||
} else {
|
} else {
|
||||||
$article_categorys_two[$vv['pid']][] = $vv;
|
$article_categorys_two[$vv['pid']][] = $vv;
|
||||||
@@ -342,8 +378,18 @@ class TopicNas extends Common
|
|||||||
->language($this->lang_id)
|
->language($this->lang_id)
|
||||||
->where('category_id', 'IN', array_column($categorys, 'id'))
|
->where('category_id', 'IN', array_column($categorys, 'id'))
|
||||||
->select();
|
->select();
|
||||||
|
//查询上级id
|
||||||
|
$parent_two = ArticleCategoryModel::parentColumn(array_column($categorys, 'id'))->language($this->lang_id)->column('pid','id');//二级分类id
|
||||||
|
$articles_data = $articles->toArray();
|
||||||
|
foreach ($articles_data as &$v) {
|
||||||
|
$v['pid'] = 0;
|
||||||
|
if ( $parent_two[$v['category_id']] !== $parent ) {
|
||||||
|
$v['pid'] = $v['category_id'];
|
||||||
|
$v['category_id'] = $parent_two[$v['category_id']];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return success('success', $articles->toArray());
|
return success('success', $articles_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -56,6 +56,16 @@ class ArticleCategoryModel extends ArticleCategoryBaseModel
|
|||||||
$query->where('pid', '=', $parent);
|
$query->where('pid', '=', $parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 所属上级分类查询
|
||||||
|
public function scopeParentColumn($query, $parent)
|
||||||
|
{
|
||||||
|
if (is_array($parent)) {
|
||||||
|
$query->where('id', 'IN', $parent);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$query->where('id', '=', $parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 所属子分类范围查询
|
// 所属子分类范围查询
|
||||||
public function scopeChild($query, $id, $merge_self = false)
|
public function scopeChild($query, $id, $merge_self = false)
|
||||||
|
|||||||
@@ -58,37 +58,7 @@
|
|||||||
{notempty name="article_categorys"}
|
{notempty name="article_categorys"}
|
||||||
<div class="nav-tree">
|
<div class="nav-tree">
|
||||||
|
|
||||||
<!-- start 三级菜单测试用例 可删-->
|
|
||||||
<div class="categoryhelp">
|
|
||||||
<div class="categoryhelp-title">
|
|
||||||
<div><img src="__IMAGES__/nars-jt.png" class="arrow">
|
|
||||||
</div>
|
|
||||||
<span>初次使用</span>
|
|
||||||
</div>
|
|
||||||
<ul class="sub-list">
|
|
||||||
<li class="two-mues">
|
|
||||||
<a href="/mobile/tops_nas/helper_detail/id/1638.html" class="two-a">
|
|
||||||
<div><img src="__IMAGES__/nars-jt.png"
|
|
||||||
class="arrow">
|
|
||||||
</div>
|
|
||||||
<span>我是2级</span>
|
|
||||||
</a>
|
|
||||||
<ul class="thress-mues">
|
|
||||||
<li>
|
|
||||||
<a href="/mobile/tops_nas/helper_detail/id/1635.html"
|
|
||||||
style="margin-left:18%;padding: 0.4rem;">我是三级</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="/mobile/tops_nas/helper_detail/id/1635.html">如何将我的NAS设备分享给他人使用?</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="/mobile/tops_nas/helper_detail/id/1639.html">设备安装中常见的问题</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<!-- end 三级菜单测试用例 可删-->
|
|
||||||
{volist name="article_categorys" id="ac" key="idx"}
|
{volist name="article_categorys" id="ac" key="idx"}
|
||||||
<div class="categoryhelp">
|
<div class="categoryhelp">
|
||||||
<div class="categoryhelp-title">
|
<div class="categoryhelp-title">
|
||||||
@@ -99,6 +69,24 @@
|
|||||||
<span>{$ac.name}</span>
|
<span>{$ac.name}</span>
|
||||||
</div>
|
</div>
|
||||||
<ul class="sub-list" {if condition='$ac.id == $Request.get.cid' }style="display: block;" {/if}>
|
<ul class="sub-list" {if condition='$ac.id == $Request.get.cid' }style="display: block;" {/if}>
|
||||||
|
{volist name="ac.child" id="ad"}
|
||||||
|
<li class="two-mues">
|
||||||
|
<a href="#" class="two-a">
|
||||||
|
<div><img src="__IMAGES__/nars-jt.png"
|
||||||
|
class="arrow {if condition='$ad.id == $Request.get.pid'}rotate{/if}">
|
||||||
|
</div>
|
||||||
|
<span>{$ad.name}</span>
|
||||||
|
</a>
|
||||||
|
<ul class="thress-mues" {if condition='$ad.id == $Request.get.pid' }style="display: block;" {/if}>
|
||||||
|
{volist name="ad.article" id="ae"}
|
||||||
|
<li>
|
||||||
|
<a href="{:url('/index/topic/nas/help_detail', ['cid' => $ac.id ,'pid' => $ad.id, 'id' => $ae.id])}"
|
||||||
|
style="margin-left:18%;padding: 0.4rem;">{$ae.title}</a>
|
||||||
|
</li>
|
||||||
|
{/volist}
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
{/volist}
|
||||||
{volist name="ac.article" id="ar"}
|
{volist name="ac.article" id="ar"}
|
||||||
<li>
|
<li>
|
||||||
<a href="{:url('/index/topic/nas/help_detail', ['cid' => $ac.id , 'id' => $ar.id])}"
|
<a href="{:url('/index/topic/nas/help_detail', ['cid' => $ac.id , 'id' => $ar.id])}"
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="nhlp-tx-list">
|
<div class="nhlp-tx-list">
|
||||||
{volist name="vo.article" id="va" key="index"}
|
{volist name="vo.article" id="va" key="index"}
|
||||||
<a class="txrow" href="{:url('/index/topic/nas/help_detail', ['cid' => $vo.id, 'id' => $va.id])}">
|
<a class="txrow" href="{:url('/index/topic/nas/help_detail', ['pid' => $va.category_id,'cid' => $vo.id, 'id' => $va.id])}">
|
||||||
<div class="nhlp-point"></div>
|
<div class="nhlp-point"></div>
|
||||||
<span class="nhlpsp">{$va.title}</span>
|
<span class="nhlpsp">{$va.title}</span>
|
||||||
<span class="narhelpgoimg">
|
<span class="narhelpgoimg">
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
</a>
|
</a>
|
||||||
{/volist}
|
{/volist}
|
||||||
{if condition="count($vo.article) >= 3"}
|
{if condition="count($vo.article) >= 3"}
|
||||||
<a class="ckgdbt" href="{:url('/index/topic/nas/help_detail', ['cid' => $vo.id, 'id' => isset($vo.article[0])?$vo.article[0]['id']:0])}">
|
<a class="ckgdbt" href="{:url('/index/topic/nas/help_detail', ['cid' => $vo.id, 'id' => isset($vo.article[0])?$vo.article[0]['id']:0,'pid' => isset($vo.article[0])?$vo.article[0]['category_id']:0])}">
|
||||||
{:lang_i18n('查看更多')} >
|
{:lang_i18n('查看更多')} >
|
||||||
</a>
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
{notempty name="article_categorys"}
|
{notempty name="article_categorys"}
|
||||||
<div class="nav-tree">
|
<div class="nav-tree">
|
||||||
|
|
||||||
<!-- start 三级菜单的测试代码 可删-->
|
<!-- start 三级菜单 -->
|
||||||
{volist name="article_categorys" id="ac"}
|
{volist name="article_categorys" id="ac"}
|
||||||
<div class="category">
|
<div class="category">
|
||||||
<!-- 一级 -->
|
<!-- 一级 -->
|
||||||
@@ -46,12 +46,12 @@
|
|||||||
{volist name="ac.child" id="ad"}
|
{volist name="ac.child" id="ad"}
|
||||||
<li class="two-mues">
|
<li class="two-mues">
|
||||||
<a href="#" class="two-a">
|
<a href="#" class="two-a">
|
||||||
<div class="arrow"><img src="__IMAGES__/nas-jt.png" class="arrow" /></div>
|
<div class="arrow {if condition='$ad.id == $Request.get.pid'}rotate{/if}"><img src="__IMAGES__/nas-jt.png" class="arrow {if condition='$ad.id == $Request.get.pid'}rotate{/if}" /></div>
|
||||||
<span>{$ad.name}</span>
|
<span>{$ad.name}</span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="thress-mues">
|
<ul class="thress-mues" {if condition='$ad.id == $Request.get.pid' }style="display: block;" {/if}>
|
||||||
{volist name="ad.article" id="ae"}
|
{volist name="ad.article" id="ae"}
|
||||||
<li><a href="{:url('/index/topic/nas/help_detail', ['cid' => $ad.id, 'id' => $ae.id])}" style="padding-top: 6px;padding-left: 30px;" {eq
|
<li><a href="{:url('/index/topic/nas/help_detail', ['cid' => $ac.id,'pid' => $ad.id, 'id' => $ae.id])}" style="padding-top: 6px;padding-left: 30px;" {eq
|
||||||
name="ae.id" value="$Request.get.id" }class="active" {/eq}>{$ae.title}</a></li>
|
name="ae.id" value="$Request.get.id" }class="active" {/eq}>{$ae.title}</a></li>
|
||||||
{/volist}
|
{/volist}
|
||||||
</ul>
|
</ul>
|
||||||
@@ -62,33 +62,12 @@
|
|||||||
<li><a href="{:url('/index/topic/nas/help_detail', ['cid' => $ac.id, 'id' => $ar.id])}" style="padding-top: 6px;" {eq
|
<li><a href="{:url('/index/topic/nas/help_detail', ['cid' => $ac.id, 'id' => $ar.id])}" style="padding-top: 6px;" {eq
|
||||||
name="ar.id" value="$Request.get.id" }class="active" {/eq}>{$ar.title}</a></li>
|
name="ar.id" value="$Request.get.id" }class="active" {/eq}>{$ar.title}</a></li>
|
||||||
{/volist}
|
{/volist}
|
||||||
<!-- <li><a href="#">APP无法下载/下载失败怎么办?</a></li>-->
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{/volist}
|
{/volist}
|
||||||
<!-- end 三级菜单的测试代码 可删-->
|
<!-- end 三级菜单 -->
|
||||||
|
|
||||||
<!-- {volist name="article_categorys" id="ac"}-->
|
|
||||||
<!-- <div class="category">-->
|
|
||||||
<!-- <div class="category-title">-->
|
|
||||||
<!-- <div class="arrow {if condition='$ac.id == $Request.get.cid'}rotate{/if}">-->
|
|
||||||
<!-- <img src="__IMAGES__/nas-jt.png"-->
|
|
||||||
<!-- class="arrow {if condition='$ac.id == $Request.get.cid'}rotate{/if}" />-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- <span>{$ac.name}</span>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- <ul class="sub-list" {if condition='$ac.id == $Request.get.cid' }style="display: block;" {/if}>-->
|
|
||||||
<!-- {volist name="ac.article" id="ar"}-->
|
|
||||||
<!-- <li>-->
|
|
||||||
<!-- <a href="{:url('/index/topic/nas/help_detail', ['cid' => $ac.id, 'id' => $ar.id])}" {eq-->
|
|
||||||
<!-- name="ar.id" value="$Request.get.id" }class="active" {/eq}>-->
|
|
||||||
<!-- {$ar.title}-->
|
|
||||||
<!-- </a>-->
|
|
||||||
<!-- </li>-->
|
|
||||||
<!-- {/volist}-->
|
|
||||||
<!-- </ul>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- {/volist}-->
|
|
||||||
</div>
|
</div>
|
||||||
{/notempty}
|
{/notempty}
|
||||||
</div>
|
</div>
|
||||||
@@ -156,7 +135,7 @@
|
|||||||
html = '<ul>'
|
html = '<ul>'
|
||||||
$.each(r.data, function (k, v) {
|
$.each(r.data, function (k, v) {
|
||||||
html +=
|
html +=
|
||||||
'<li><a href="{:url(\'/index/topic/nas/help_detail\')}?cid=' + v.category_id + '&id=' + v.id + '">' + v.title + '</a></li>'
|
'<li><a href="{:url(\'/index/topic/nas/help_detail\')}?cid=' + v.category_id + '&id=' + v.id + '&pid=' + v.pid + '">' + v.title + '</a></li>'
|
||||||
})
|
})
|
||||||
html += '</ul>'
|
html += '</ul>'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,6 +135,7 @@
|
|||||||
transform: rotate(0deg);
|
transform: rotate(0deg);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
flex-direction: column-reverse;
|
||||||
}
|
}
|
||||||
|
|
||||||
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .arrow .nars-jt {
|
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .arrow .nars-jt {
|
||||||
|
|||||||
Reference in New Issue
Block a user