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
1c7144db
Commit
1c7144db
authored
Jun 18, 2019
by
Hsinli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of t-git.51gjj.com:fangbin/51business
parents
069d47cf
b68c4ac3
Pipeline
#9057
passed with stage
in 14 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
tool.js
app/controller/house/v2/tool.js
+1
-1
rental_house.js
app/service/house/v2/rental_house.js
+6
-7
No files found.
app/controller/house/v2/tool.js
View file @
1c7144db
...
...
@@ -256,7 +256,7 @@ class ToolController extends Controller {
for
(
let
i
in
city_list
)
{
const
city
=
city_list
[
i
];
const
children
=
districts
.
filter
(
item
=>
{
return
(
parseInt
(
item
.
city_id
)
===
parseInt
(
city
.
code
))
?
true
:
false
});
city
.
_children
=
children
.
map
(
item
=>
{
return
{
id
:
item
.
id
,
name
:
item
.
name
,
code
:
item
.
name
}
});
city
.
_children
=
children
.
map
(
item
=>
{
return
{
id
:
item
.
id
,
name
:
item
.
name
,
code
:
item
.
id
}
});
results
.
push
(
city
);
}
...
...
app/service/house/v2/rental_house.js
View file @
1c7144db
...
...
@@ -80,23 +80,22 @@ class RentalHouseService extends Service {
const
house_types_rets
=
await
ctx
.
realestateModel
.
RentalHouseType
.
all
({
where
:
{
rental_house_id
:
rental_house_id
,
status
:
'online'
,
valid
:
1
}
});
const
p_house_images
=
ctx
.
service
.
house
.
v2
.
houseImage
.
getAll
({
type
:
1
,
connect_id
:
rental_house_id
},
[
'id'
,
'path'
,
'description'
]);
const
p_house_types
=
this
.
formatRentHouseTypes
(
house_types_rets
);
const
p_ret
=
await
Promise
.
all
([
p_house_images
,
p_house_types
]).
then
(
result
=>
{
//等待所有异步内容获取完成
const
p_collection
=
await
ctx
.
service
.
house
.
v2
.
collection
.
getCollection
({
type
:
2
,
id
:
rental_house_id
});
const
p_ret
=
await
Promise
.
all
([
p_house_images
,
p_house_types
,
p_collection
]).
then
(
result
=>
{
//等待所有异步内容获取完成
return
result
;
}).
catch
(
error
=>
{
ctx
.
failed
(
error
);
});
const
house_images
=
p_ret
[
0
];
const
house_types
=
p_ret
[
1
];
const
collection
=
p_ret
[
2
];
//是否关注
//处理房源基本信息格式
let
house_basic
=
await
this
.
formatRentalHouseBasic
([
rental_house_info
]);
house_basic
=
house_basic
[
0
];
//添加用户足迹,是否关注过房源
await
ctx
.
service
.
house
.
v2
.
footPrint
.
addFootPrint
({
type
:
2
,
id
:
rental_house_id
});
//是否关注
let
collectionTask
=
await
ctx
.
service
.
house
.
collection
.
getCollection
({
type
:
2
,
id
:
rental_house_id
});
//添加用户足迹
ctx
.
service
.
house
.
v2
.
footPrint
.
addFootPrint
({
type
:
2
,
id
:
rental_house_id
});
const
city_codes
=
[
rental_house_info
.
province
,
rental_house_info
.
city
,
rental_house_info
.
area
];
const
cities
=
await
ctx
.
blockModel
.
City
.
all
({
where
:
{
code
:
{
$in
:
city_codes
}
}
});
...
...
@@ -106,7 +105,7 @@ class RentalHouseService extends Service {
house_basic
.
longitude
=
gps_info
.
lng
;
house_basic
.
latitude
=
gps_info
.
lat
;
return
{
house_basic
,
house_images
,
house_types
,
collection
:
collection
Task
,
};
return
{
house_basic
,
house_images
,
house_types
,
collection
:
collection
.
length
>
0
?
true
:
false
,
};
}
//格式化户型数据
...
...
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