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
b2eca23e
Commit
b2eca23e
authored
Jun 20, 2019
by
Hsinli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
9f8af8aa
Pipeline
#9262
passed with stage
in 18 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
3 deletions
+46
-3
collection.js
app/service/house/v2/collection.js
+40
-3
foot_print.js
app/service/house/v2/foot_print.js
+3
-0
order.js
app/service/house/v2/order.js
+3
-0
No files found.
app/service/house/v2/collection.js
View file @
b2eca23e
...
@@ -133,6 +133,9 @@ class CollectionService extends Service {
...
@@ -133,6 +133,9 @@ class CollectionService extends Service {
});
});
//数据整理
//数据整理
for
(
let
j
in
retList
)
{
for
(
let
j
in
retList
)
{
if
(
retList
[
j
].
status
===
'offline'
||
Number
(
retList
[
j
].
valid
)
===
0
)
{
continue
;
}
let
type
=
collectionList
[
j
].
house_style
;
let
type
=
collectionList
[
j
].
house_style
;
let
tmp
=
{
let
tmp
=
{
id
:
retList
[
j
].
id
,
id
:
retList
[
j
].
id
,
...
@@ -166,8 +169,7 @@ class CollectionService extends Service {
...
@@ -166,8 +169,7 @@ class CollectionService extends Service {
}
}
let
endDate
=
moment
().
subtract
(
6
,
'months'
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
let
endDate
=
moment
().
subtract
(
6
,
'months'
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
let
filter
=
{
let
filter
=
{
page
:
1
,
attributes
:
[
'connect_id'
,
'house_style'
],
limit
:
50
,
where
:
{
where
:
{
state
:
1
,
state
:
1
,
user_id
:
ctx
.
userId
,
user_id
:
ctx
.
userId
,
...
@@ -176,8 +178,43 @@ class CollectionService extends Service {
...
@@ -176,8 +178,43 @@ class CollectionService extends Service {
order
:
[[
'created_at'
,
'desc'
]]
order
:
[[
'created_at'
,
'desc'
]]
}
}
let
collectionList
=
await
ctx
.
realestateModel
.
Collection
.
all
(
filter
);
let
collectionList
=
await
ctx
.
realestateModel
.
Collection
.
all
(
filter
);
let
count
=
0
;
if
(
collectionList
.
length
>
0
)
{
let
newHouseId
=
[];
let
rentalHouseId
=
[];
for
(
let
i
in
collectionList
)
{
if
(
Number
(
collectionList
[
i
].
house_style
)
===
1
)
{
newHouseId
.
push
(
collectionList
[
i
].
connect_id
);
}
if
(
Number
(
collectionList
[
i
].
house_style
)
===
2
)
{
rentalHouseId
.
push
(
collectionList
[
i
].
connect_id
);
}
}
let
newHousefilter
=
{
where
:
{
status
:
'online'
,
valid
:
1
,
id
:
{
$in
:
newHouseId
},
},
}
let
newHouseCountTask
=
ctx
.
realestateModel
.
NewHouse
.
count
(
newHousefilter
);
let
rentalHousefilter
=
{
where
:
{
status
:
'online'
,
valid
:
1
,
id
:
{
$in
:
newHouseId
},
},
}
let
rentalHouseCountTask
=
ctx
.
realestateModel
.
RentalHouse
.
count
(
rentalHousefilter
);
const
retList
=
await
Promise
.
all
([
newHouseCountTask
,
rentalHouseCountTask
]).
then
(
result
=>
{
return
result
;
}).
catch
(
error
=>
{
ctx
.
failed
(
error
);
});
count
=
Number
(
retList
[
0
])
+
Number
(
retList
[
1
]);
}
let
ret
=
{
let
ret
=
{
count
:
co
llectionList
.
length
count
:
co
unt
};
};
return
ret
;
return
ret
;
}
}
...
...
app/service/house/v2/foot_print.js
View file @
b2eca23e
...
@@ -73,6 +73,9 @@ class FootPrintService extends Service {
...
@@ -73,6 +73,9 @@ class FootPrintService extends Service {
//处理足迹数据
//处理足迹数据
const
foot_print_records
=
[];
const
foot_print_records
=
[];
for
(
let
j
in
houses
)
{
for
(
let
j
in
houses
)
{
if
(
retList
[
j
].
status
===
'offline'
||
Number
(
retList
[
j
].
valid
)
===
0
)
{
continue
;
}
const
house
=
houses
[
j
];
const
house
=
houses
[
j
];
const
foot_print
=
foot_prints
[
j
];
const
foot_print
=
foot_prints
[
j
];
const
type
=
foot_print
.
house_style
===
1
?
'new_house'
:
'rental_house'
;
const
type
=
foot_print
.
house_style
===
1
?
'new_house'
:
'rental_house'
;
...
...
app/service/house/v2/order.js
View file @
b2eca23e
...
@@ -85,6 +85,9 @@ class OrderService extends Service {
...
@@ -85,6 +85,9 @@ class OrderService extends Service {
});
});
//数据整理
//数据整理
for
(
let
j
in
retList
)
{
for
(
let
j
in
retList
)
{
if
(
retList
[
j
].
status
===
'offline'
||
Number
(
retList
[
j
].
valid
)
===
0
)
{
continue
;
}
let
type
=
orderList
[
j
].
house_style
;
let
type
=
orderList
[
j
].
house_style
;
let
tmp
=
{
let
tmp
=
{
id
:
retList
[
j
].
id
,
id
:
retList
[
j
].
id
,
...
...
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