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
65932fa9
Commit
65932fa9
authored
Apr 16, 2019
by
方斌
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://t-git.51gjj.com/fangbin/51business
parents
92e33373
4c11a9a4
Pipeline
#6048
passed with stage
in 19 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
9 deletions
+71
-9
collection.js
app/controller/house/collection.js
+19
-0
house.js
app/router/house.js
+5
-4
collection.js
app/service/house/collection.js
+44
-2
new_house.js
app/service/house/new_house.js
+2
-2
rental_house.js
app/service/house/rental_house.js
+1
-1
No files found.
app/controller/house/collection.js
View file @
65932fa9
...
...
@@ -33,6 +33,25 @@ class CollectionController extends Controller {
ctx
.
success
(
ret
);
}
async
unCollection
(){
const
{
ctx
}
=
this
;
let
inputParams
=
ctx
.
request
.
body
;
const
rule
=
{
id
:
{
type
:
'integer'
,
required
:
true
,
},
type
:
{
type
:
'integer'
,
required
:
true
,
}
};
ctx
.
validate
(
rule
,
inputParams
);
let
ret
=
await
ctx
.
service
.
house
.
collection
.
unCollection
(
inputParams
);
ctx
.
success
(
ret
);
}
}
module
.
exports
=
CollectionController
;
app/router/house.js
View file @
65932fa9
...
...
@@ -28,12 +28,13 @@ module.exports = app => {
router
.
post
(
'/order'
,
loginAuth
,
'house.order.addOrder'
);
//预约
router
.
get
(
'/order/list'
,
loginAuth
,
'house.order.getOrderList'
);
//预约列表
//收藏
router
.
post
(
'/collection'
,
loginAuth
,
'house.collection.addCollection'
);
//收藏
router
.
get
(
'/collection/list'
,
loginAuth
,
'house.collection.getCollectionList'
);
//收藏列表
//关注
router
.
post
(
'/collection'
,
loginAuth
,
'house.collection.addCollection'
);
//关注
router
.
get
(
'/collection/list'
,
loginAuth
,
'house.collection.getCollectionList'
);
//关注列表
router
.
put
(
'/collection'
,
loginAuth
,
'house.collection.unCollection'
);
//取消关注
//搜索历史
router
.
get
(
'/search_history'
,
'house.searchHistory.getsearchHistory'
);
//
收藏列表
router
.
get
(
'/search_history'
,
'house.searchHistory.getsearchHistory'
);
//
搜索历史
router
.
put
(
'/search_history/:type'
,
'house.searchHistory.cleanSearchHistory'
);
//用户点击清除搜索记录
//足迹
...
...
app/service/house/collection.js
View file @
65932fa9
...
...
@@ -7,7 +7,7 @@ const moment = require('moment');
class
CollectionService
extends
Service
{
/**
* 添加
收藏
* 添加
关注
* @param {object} inputParams
*/
async
addCollection
(
inputParams
)
{
...
...
@@ -53,6 +53,48 @@ class CollectionService extends Service {
}
/**
* 取消关注
* @param {object} inputParams
*/
async
unCollection
(
inputParams
)
{
const
{
ctx
,
service
}
=
this
;
let
ret
=
{
status
:
true
};
if
(
!
ctx
.
appUserId
||
!
ctx
.
deviceId
||
!
ctx
.
deviceLoginId
||
!
ctx
.
userId
)
{
//如果没有登录就不做处理
return
ret
;
}
let
filter
=
{
pageIndex
:
1
,
pageSize
:
999
,
queryConditions
:
[{
key
:
"state"
,
value
:
1
,
operator
:
"equal"
},
{
key
:
"userId"
,
value
:
ctx
.
userId
,
operator
:
"equal"
},
{
key
:
"connectId"
,
value
:
inputParams
.
id
,
operator
:
"equal"
},
{
key
:
"houseStyle"
,
value
:
inputParams
.
type
,
operator
:
"equal"
},
],
orderConditions
:
[],
}
let
collectionHistory
=
await
service
.
houseCommon
.
collection
.
all
(
filter
);
if
(
collectionHistory
.
rowCount
>
0
)
{
await
service
.
houseCommon
.
collection
.
delete
(
collectionHistory
.
results
[
0
].
id
);
}
return
ret
;
}
/**
* 获取用户关注信息
* @param {object} inputParams
*/
...
...
@@ -99,7 +141,7 @@ class CollectionService extends Service {
/**
* 获取
收藏
列表 保留最近6个月的记录,条数不超过50条
* 获取
关注
列表 保留最近6个月的记录,条数不超过50条
* @param {object} condition
*/
async
getCollectionList
()
{
...
...
app/service/house/new_house.js
View file @
65932fa9
...
...
@@ -360,7 +360,7 @@ class NewHouseService extends Service {
}
let
ret
=
{
results
:
list
,
count
:
list
.
length
count
:
newHouseList
.
rowCount
};
return
ret
;
}
...
...
@@ -451,7 +451,7 @@ class NewHouseService extends Service {
}
let
ret
=
{
results
:
list
,
count
:
list
.
length
count
:
newHouseList
.
rowCount
};
return
ret
;
}
...
...
app/service/house/rental_house.js
View file @
65932fa9
...
...
@@ -54,7 +54,7 @@ class RentalHouseService extends Service {
});
}
if
(
condition
.
name
)
{
await
service
.
house
.
searchHistory
.
addSearchHistory
({
type
:
2
,
key_word
:
condition
.
name
});
//增加搜索历史
await
ctx
.
service
.
house
.
searchHistory
.
addSearchHistory
({
type
:
2
,
key_word
:
condition
.
name
});
//增加搜索历史
queryConditions
.
push
({
key
:
'name'
,
value
:
condition
.
name
,
...
...
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