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
087281d1
Commit
087281d1
authored
Jul 16, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
house 2.1 fix
parent
3250a3ff
Pipeline
#10984
passed with stage
in 18 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
10 deletions
+35
-10
tool.js
app/controller/house/v2/tool.js
+1
-0
response.js
app/controller/response.js
+2
-2
device_init.js
app/middleware/device_init.js
+1
-1
rental_house.js
app/model/realestate/rental_house.js
+10
-1
rental_house.js
app/service/house/v2/rental_house.js
+21
-6
No files found.
app/controller/house/v2/tool.js
View file @
087281d1
...
@@ -148,6 +148,7 @@ class ToolController extends Controller {
...
@@ -148,6 +148,7 @@ class ToolController extends Controller {
const
gps_info
=
await
ctx
.
helper
.
getGPS
(
address
,
city
);
const
gps_info
=
await
ctx
.
helper
.
getGPS
(
address
,
city
);
if
(
gps_info
.
lng
&&
gps_info
.
lat
)
{
if
(
gps_info
.
lng
&&
gps_info
.
lat
)
{
result
=
{
result
=
{
house_id
,
name
:
new_house_name
,
name
:
new_house_name
,
longitude
:
gps_info
.
lng
,
longitude
:
gps_info
.
lng
,
latitude
:
gps_info
.
lat
,
latitude
:
gps_info
.
lat
,
...
...
app/controller/response.js
View file @
087281d1
...
@@ -64,7 +64,7 @@ class ResponseController extends Controller {
...
@@ -64,7 +64,7 @@ class ResponseController extends Controller {
delete
(
node_user_center_login_ret
.
device_login_logs_id
);
delete
(
node_user_center_login_ret
.
device_login_logs_id
);
}
}
if
(
!
phone
||
!
channel_id
||
!
app_id
||
!
node_user_center_login_ret
.
token
)
{
//
没有手机号
或渠道错误 或直接注册新用户中心失败时 使用设备登录
if
(
!
phone
||
!
channel_id
||
!
app_id
||
!
node_user_center_login_ret
.
token
)
{
//
或渠道错误 或直接注册新用户中心失败时 使用设备登录
const
user_agent
=
header
.
user_agent
?
header
.
user_agent
:
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36'
;
const
user_agent
=
header
.
user_agent
?
header
.
user_agent
:
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36'
;
const
ip
=
ctx
.
helper
.
getClientIP
();
const
ip
=
ctx
.
helper
.
getClientIP
();
const
device_no
=
ctx
.
helper
.
md5
(
user_agent
+
ip
);
const
device_no
=
ctx
.
helper
.
md5
(
user_agent
+
ip
);
...
@@ -101,7 +101,7 @@ class ResponseController extends Controller {
...
@@ -101,7 +101,7 @@ class ResponseController extends Controller {
const
value
=
node_user_center_login_ret
[
key
];
const
value
=
node_user_center_login_ret
[
key
];
const
exist_value
=
ctx
.
cookies
.
get
(
key
,
{
signed
:
false
});
const
exist_value
=
ctx
.
cookies
.
get
(
key
,
{
signed
:
false
});
if
(
!
exist_value
){
if
(
!
exist_value
){
ctx
.
cookies
.
set
(
key
,
value
,
{
httpOnly
:
false
,
signed
:
false
,
maxAge
:
expire
,
expires
:
date
,
path
:
'/'
});
ctx
.
cookies
.
set
(
key
,
value
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
}
}
}
}
...
...
app/middleware/device_init.js
View file @
087281d1
...
@@ -201,7 +201,7 @@ module.exports = () => {
...
@@ -201,7 +201,7 @@ module.exports = () => {
const
value
=
user_login_info
[
key
];
const
value
=
user_login_info
[
key
];
const
exist_value
=
ctx
.
cookies
.
get
(
key
,
{
signed
:
false
});
const
exist_value
=
ctx
.
cookies
.
get
(
key
,
{
signed
:
false
});
if
(
!
exist_value
)
{
if
(
!
exist_value
)
{
ctx
.
cookies
.
set
(
key
,
value
,
{
httpOnly
:
false
,
signed
:
false
,
maxAge
:
expire
,
expires
:
date
,
path
:
'/'
});
ctx
.
cookies
.
set
(
key
,
value
,
{
httpOnly
:
false
,
signed
:
false
,
path
:
'/'
,
overwrite
:
true
});
}
}
}
}
return
user_login_info
;
return
user_login_info
;
...
...
app/model/realestate/rental_house.js
View file @
087281d1
...
@@ -48,10 +48,18 @@ module.exports = app => {
...
@@ -48,10 +48,18 @@ module.exports = app => {
type
:
INTEGER
,
type
:
INTEGER
,
allowNull
:
true
allowNull
:
true
},
},
surplus_amount
:
{
type
:
INTEGER
,
allowNull
:
true
},
address
:
{
address
:
{
type
:
STRING
,
type
:
STRING
,
allowNull
:
true
allowNull
:
true
},
},
gps
:
{
type
:
STRING
,
allowNull
:
true
},
price
:
{
price
:
{
type
:
DECIMAL
,
type
:
DECIMAL
,
allowNull
:
true
allowNull
:
true
...
@@ -205,7 +213,8 @@ module.exports = app => {
...
@@ -205,7 +213,8 @@ module.exports = app => {
const
where
=
data
.
where
;
const
where
=
data
.
where
;
const
params
=
data
.
params
;
const
params
=
data
.
params
;
try
{
try
{
return
res
=
await
RentalHouse
.
update
(
params
,
{
where
:
where
})
const
res
=
await
RentalHouse
.
update
(
params
,
{
where
:
where
})
return
res
;
}
catch
(
error
)
{
}
catch
(
error
)
{
throw
(
error
);
throw
(
error
);
}
}
...
...
app/service/house/v2/rental_house.js
View file @
087281d1
...
@@ -63,7 +63,7 @@ class RentalHouseService extends Service {
...
@@ -63,7 +63,7 @@ class RentalHouseService extends Service {
const
rental_houses_results
=
await
ctx
.
realestateModel
.
RentalHouse
.
list
({
page
:
page
,
limit
:
Number
(
limit
),
where
:
where
,
order
:
[[
'order_id'
,
'desc'
],
[
'id'
,
'desc'
]]
});
const
rental_houses_results
=
await
ctx
.
realestateModel
.
RentalHouse
.
list
({
page
:
page
,
limit
:
Number
(
limit
),
where
:
where
,
order
:
[[
'order_id'
,
'desc'
],
[
'id'
,
'desc'
]]
});
let
rental_houses
=
await
this
.
formatRentalHouseBasic
(
rental_houses_results
.
rows
);
let
rental_houses
=
await
this
.
formatRentalHouseBasic
(
rental_houses_results
.
rows
);
rental_houses
=
R
.
project
([
'id'
,
'image'
,
'name'
,
'address'
,
'price'
,
'tags'
,
'favourable_info'
])(
rental_houses
);
rental_houses
=
R
.
project
([
'id'
,
'image'
,
'name'
,
'address'
,
'price'
,
'
surplus_amount'
,
'
tags'
,
'favourable_info'
])(
rental_houses
);
return
{
page
:
page
,
count
:
rental_houses_results
.
count
,
results
:
rental_houses
};
return
{
page
:
page
,
count
:
rental_houses_results
.
count
,
results
:
rental_houses
};
...
@@ -100,11 +100,24 @@ class RentalHouseService extends Service {
...
@@ -100,11 +100,24 @@ class RentalHouseService extends Service {
//添加用户足迹
//添加用户足迹
ctx
.
service
.
house
.
v2
.
footPrint
.
addFootPrint
({
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
];
let
gps_info
=
{};
const
cities
=
await
ctx
.
blockModel
.
City
.
all
({
where
:
{
code
:
{
$in
:
city_codes
}
}
});
if
(
!
rental_house_info
.
gps
)
{
const
city
=
(
cities
&&
cities
[
1
]
&&
cities
[
1
].
name
)
?
cities
[
1
].
name
:
''
;
const
city_codes
=
[
rental_house_info
.
province
,
rental_house_info
.
city
,
rental_house_info
.
area
];
const
address
=
R
.
pluck
(
'name'
,
cities
).
join
(
''
)
+
rental_house_info
.
address
;
const
cities
=
await
ctx
.
blockModel
.
City
.
all
({
where
:
{
code
:
{
$in
:
city_codes
}
}
});
const
gps_info
=
await
ctx
.
helper
.
getGPS
(
address
,
city
);
const
city
=
(
cities
&&
cities
[
1
]
&&
cities
[
1
].
name
)
?
cities
[
1
].
name
:
''
;
const
address
=
R
.
pluck
(
'name'
,
cities
).
join
(
''
)
+
rental_house_info
.
address
;
console
.
info
(
address
);
gps_info
=
await
ctx
.
helper
.
getGPS
(
address
,
city
);
ctx
.
realestateModel
.
RentalHouse
.
edit
({
where
:
{
id
:
rental_house_id
},
params
:
{
gps
:
`
${
gps_info
.
lat
}
,
${
gps_info
.
lng
}
`
}
});
}
else
{
const
gps_str
=
ctx
.
helper
.
checkGps
(
rental_house_info
.
gps
);
const
gps_array
=
gps_str
.
split
(
','
);
gps_info
=
{
lng
:
gps_array
[
1
],
lat
:
gps_array
[
0
],
}
}
house_basic
.
longitude
=
gps_info
.
lng
;
house_basic
.
longitude
=
gps_info
.
lng
;
house_basic
.
latitude
=
gps_info
.
lat
;
house_basic
.
latitude
=
gps_info
.
lat
;
...
@@ -169,11 +182,13 @@ class RentalHouseService extends Service {
...
@@ -169,11 +182,13 @@ class RentalHouseService extends Service {
image
:
rental_house
.
image
,
//列表展示图片
image
:
rental_house
.
image
,
//列表展示图片
// residential_id: rental_house.residentialId,//小区id
// residential_id: rental_house.residentialId,//小区id
address
:
rental_house
.
address
,
//详细地址
address
:
rental_house
.
address
,
//详细地址
gps
:
rental_house
.
gps
,
//项目地址经纬度
price
:
rental_house
.
price
,
//价格
price
:
rental_house
.
price
,
//价格
discount
:
rental_house
.
discount
,
//折扣
discount
:
rental_house
.
discount
,
//折扣
// business_license: rental_house.businessLicense,
// business_license: rental_house.businessLicense,
tags
:
rental_house
.
tags
,
//房源特点
tags
:
rental_house
.
tags
,
//房源特点
rental_type
:
rental_house
.
rental_type
,
//租房类型 1整租 2合租 3独栋公寓
rental_type
:
rental_house
.
rental_type
,
//租房类型 1整租 2合租 3独栋公寓
surplus_amount
:
rental_house
.
surplus_amount
,
//剩余数量 目前如果为0则展示 "满租",其他情况不展示
favourable_info
:
rental_house
.
favourable_info
,
//优惠信息
favourable_info
:
rental_house
.
favourable_info
,
//优惠信息
introduce
:
rental_house
.
description
||
`该社区亮点:
introduce
:
rental_house
.
description
||
`该社区亮点:
1、房源介绍:精装公寓,家电齐全,独立卫生间,南通北透,独门独户。
1、房源介绍:精装公寓,家电齐全,独立卫生间,南通北透,独门独户。
...
...
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