Authored by 毕凯

Merge branch 'hotfix/qaSearch' into 'master'

强制类型转换



See merge request !529
@@ -56,12 +56,12 @@ const qaDetail = (params) => { @@ -56,12 +56,12 @@ const qaDetail = (params) => {
56 56
57 // 根据子id,父id,关键字,匹配问题详情 57 // 根据子id,父id,关键字,匹配问题详情
58 if (params.keyword) { 58 if (params.keyword) {
59 - // 从搜索列表进入,有关键字 59 + // 从搜索列表进入,有关键字
60 if (result && result[1] && result[1].data) { 60 if (result && result[1] && result[1].data) {
61 let keyList = result[1].data.helper_list; 61 let keyList = result[1].data.helper_list;
62 62
63 _.forEach(keyList, function(val) { 63 _.forEach(keyList, function(val) {
64 - if (val.id === params.sonId) { 64 + if (parseInt(val.id, 10) === parseInt(params.sonId, 10)) {
65 resu = { 65 resu = {
66 caption: val.caption, 66 caption: val.caption,
67 content: val.content 67 content: val.content
@@ -70,11 +70,11 @@ const qaDetail = (params) => { @@ -70,11 +70,11 @@ const qaDetail = (params) => {
70 }); 70 });
71 } 71 }
72 } else { 72 } else {
73 - // 常见问题没有parentId 73 + // 常见问题没有parentId
74 if (result && result[0] && result[0].data) { 74 if (result && result[0] && result[0].data) {
75 if (!params.parentId) { 75 if (!params.parentId) {
76 _.forEach(result[0].data.faqs, function(val) { 76 _.forEach(result[0].data.faqs, function(val) {
77 - if (val.id === params.sonId) { 77 + if (parseInt(val.id, 10) === parseInt(params.sonId, 10)) {
78 resu = { 78 resu = {
79 caption: val.caption, 79 caption: val.caption,
80 content: val.content 80 content: val.content
@@ -83,10 +83,10 @@ const qaDetail = (params) => { @@ -83,10 +83,10 @@ const qaDetail = (params) => {
83 }); 83 });
84 } else { 84 } else {
85 _.forEach(result[0].data.categorys, function(val) { 85 _.forEach(result[0].data.categorys, function(val) {
86 - if (val.id === params.parentId) { 86 + if (parseInt(val.id, 10) === parseInt(params.parentId, 10)) {
87 _.forEach(val.contentItems, function(item) { 87 _.forEach(val.contentItems, function(item) {
88 88
89 - if (item.id === params.sonId) { 89 + if (parseInt(item.id, 10) === parseInt(params.sonId, 10)) {
90 resu = { 90 resu = {
91 caption: item.caption, 91 caption: item.caption,
92 content: item.content 92 content: item.content