Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
方斌
51business
Commits
a7b70be6
Commit
a7b70be6
authored
Feb 28, 2020
by
Hsinli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
643b8ab7
Pipeline
#19661
passed with stage
in 1 minute 5 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
2 deletions
+36
-2
presell_search_history.js
app/controller/cd/presell_search_history.js
+28
-0
cd.js
app/router/cd.js
+7
-1
presell_search_history.js
app/service/cd/presell_search_history.js
+1
-1
No files found.
app/controller/cd/presell_search_history.js
0 → 100644
View file @
a7b70be6
'use strict'
;
const
Controller
=
require
(
'egg'
).
Controller
;
class
PresellSearchHistoryController
extends
Controller
{
/**
* 获取搜索历史
*/
async
getSearchHistory
()
{
const
{
ctx
}
=
this
;
let
ret
=
await
ctx
.
service
.
cd
.
presellSearchHistory
.
getSearchHistory
();
ctx
.
success
(
ret
);
}
/**
* 清除搜索记录
*/
async
cleanSearchHistory
()
{
const
{
ctx
}
=
this
;
let
ret
=
await
ctx
.
service
.
cd
.
presellSearchHistory
.
cleanSearchHistory
();
ctx
.
success
(
ret
);
}
}
module
.
exports
=
PresellSearchHistoryController
;
app/router/cd.js
View file @
a7b70be6
...
@@ -10,7 +10,12 @@ module.exports = app => {
...
@@ -10,7 +10,12 @@ module.exports = app => {
//资讯详细内容
//资讯详细内容
router
.
get
(
'third'
,
'/news/:id'
,
'cd.news.getNews'
);
router
.
get
(
'third'
,
'/news/:id'
,
'cd.news.getNews'
);
//预售楼盘搜索历史
router
.
get
(
'/presell/search_history'
,
loginAuth
,
'cd.presellSearchHistory.getSearchHistory'
);
//清除预售楼盘搜索历史
router
.
put
(
'/presell/search_history'
,
loginAuth
,
'cd.presellSearchHistory.getSearchHistory'
);
};
};
\ No newline at end of file
app/service/cd/presell_search_history.js
View file @
a7b70be6
...
@@ -36,7 +36,7 @@ class PresellSearchHistoryService extends Service {
...
@@ -36,7 +36,7 @@ class PresellSearchHistoryService extends Service {
* 排序根据搜索时间逆序排列,距离当前时间近的排在前面,重复搜索的关键词取最近一次的搜索时间进行排序
* 排序根据搜索时间逆序排列,距离当前时间近的排在前面,重复搜索的关键词取最近一次的搜索时间进行排序
* 如果没有搜索记录的就不显示搜索词
* 如果没有搜索记录的就不显示搜索词
*/
*/
async
get
List
()
{
async
get
SearchHistory
()
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
let
ret
=
{
let
ret
=
{
search_history
:
{
search_history
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment