Showing
1 changed file
with
21 additions
and
1 deletions
@@ -162,11 +162,31 @@ const searchRecommend = (req, res, next) => { | @@ -162,11 +162,31 @@ const searchRecommend = (req, res, next) => { | ||
162 | }).catch(next); | 162 | }).catch(next); |
163 | }; | 163 | }; |
164 | 164 | ||
165 | +/** | ||
166 | + * 搜索少或无 有可能喜欢 | ||
167 | + **/ | ||
168 | +const searchLessRecommend = (req, res, next) => { | ||
169 | + let channel = req.yoho.channel; | ||
170 | + let uid = req.user.uid; | ||
171 | + let udid = req.yoho.udid; | ||
172 | + let page = Number(req.query.page || 1); | ||
173 | + | ||
174 | + if (page <= 0 || page >= 6) { | ||
175 | + page = 1; | ||
176 | + } | ||
177 | + | ||
178 | + search.getSearchLessProduct(channel, uid, udid, page).then(result => { | ||
179 | + return res.send(result); | ||
180 | + }).catch(next); | ||
181 | + | ||
182 | +}; | ||
183 | + | ||
165 | module.exports = { | 184 | module.exports = { |
166 | index, | 185 | index, |
167 | suggest, | 186 | suggest, |
168 | suggest4Old, | 187 | suggest4Old, |
169 | searchFilterBrands, | 188 | searchFilterBrands, |
170 | searchHistory, // 搜索历史记录 | 189 | searchHistory, // 搜索历史记录 |
171 | - searchRecommend // 搜索框下方 热门搜索 | 190 | + searchRecommend, // 搜索框下方 热门搜索 |
191 | + searchLessRecommend | ||
172 | }; | 192 | }; |
-
Please register or login to post a comment