Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
lijing
8 years ago
Commit
4a2b6434434128f4e0c7b980400d1b8969f0be16
1 parent
538ddd14
强制类型转换
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
apps/service/models/chatQa.js
apps/service/models/chatQa.js
View file @
4a2b643
...
...
@@ -56,12 +56,12 @@ const qaDetail = (params) => {
// 根据子id,父id,关键字,匹配问题详情
if
(
params
.
keyword
)
{
// 从搜索列表进入,有关键字
// 从搜索列表进入,有关键字
if
(
result
&&
result
[
1
]
&&
result
[
1
].
data
)
{
let
keyList
=
result
[
1
].
data
.
helper_list
;
_
.
forEach
(
keyList
,
function
(
val
)
{
if
(
val
.
id
===
params
.
sonId
)
{
if
(
parseInt
(
val
.
id
,
10
)
===
parseInt
(
params
.
sonId
,
10
)
)
{
resu
=
{
caption
:
val
.
caption
,
content
:
val
.
content
...
...
@@ -70,11 +70,11 @@ const qaDetail = (params) => {
});
}
}
else
{
// 常见问题没有parentId
// 常见问题没有parentId
if
(
result
&&
result
[
0
]
&&
result
[
0
].
data
)
{
if
(
!
params
.
parentId
)
{
_
.
forEach
(
result
[
0
].
data
.
faqs
,
function
(
val
)
{
if
(
val
.
id
===
params
.
sonId
)
{
if
(
parseInt
(
val
.
id
,
10
)
===
parseInt
(
params
.
sonId
,
10
)
)
{
resu
=
{
caption
:
val
.
caption
,
content
:
val
.
content
...
...
@@ -83,10 +83,10 @@ const qaDetail = (params) => {
});
}
else
{
_
.
forEach
(
result
[
0
].
data
.
categorys
,
function
(
val
)
{
if
(
val
.
id
===
params
.
parentId
)
{
if
(
parseInt
(
val
.
id
,
10
)
===
parseInt
(
params
.
parentId
,
10
)
)
{
_
.
forEach
(
val
.
contentItems
,
function
(
item
)
{
if
(
item
.
id
===
params
.
sonId
)
{
if
(
parseInt
(
item
.
id
,
10
)
===
parseInt
(
params
.
sonId
,
10
)
)
{
resu
=
{
caption
:
item
.
caption
,
content
:
item
.
content
...
...
Please
register
or
login
to post a comment