Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shouzhouServer
Overview
Overview
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
chenjinjing
shouzhouServer
Commits
093e6e07
Commit
093e6e07
authored
Jul 22, 2024
by
Leo Zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新了一些返回格式
parent
d562e619
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
merchantBusinessStatisticsStrategy.ts
...p2/strategies/right/merchantBusinessStatisticsStrategy.ts
+3
-3
visitorGenderProfileStrategy.ts
...biz/map2/strategies/right/visitorGenderProfileStrategy.ts
+8
-4
visitorHomeProfileStrategy.ts
src/biz/map2/strategies/right/visitorHomeProfileStrategy.ts
+3
-7
No files found.
src/biz/map2/strategies/right/merchantBusinessStatisticsStrategy.ts
View file @
093e6e07
...
@@ -12,15 +12,15 @@ export default class merchantBusinessStatisticsStrategy extends abstractMerchant
...
@@ -12,15 +12,15 @@ export default class merchantBusinessStatisticsStrategy extends abstractMerchant
const
result
=
[
const
result
=
[
{
{
key
:
'
totalBusinesses
'
,
key
:
'
营业商家数
'
,
value
:
totalBusinesses
value
:
totalBusinesses
},
},
{
{
key
:
'
totalShops
'
,
key
:
'
营业店铺数
'
,
value
:
totalShops
value
:
totalShops
},
},
{
{
key
:
'
businessActivityRate
'
,
key
:
'
商家动销率
'
,
value
:
businessActivityRate
value
:
businessActivityRate
}
}
];
];
...
...
src/biz/map2/strategies/right/visitorGenderProfileStrategy.ts
View file @
093e6e07
...
@@ -27,10 +27,14 @@ export default class visitorGenderProfileStrategy extends abstractCustomerProfil
...
@@ -27,10 +27,14 @@ export default class visitorGenderProfileStrategy extends abstractCustomerProfil
femaleCount
=
total
-
maleCount
;
femaleCount
=
total
-
maleCount
;
}
}
const
result
=
{
const
result
=
type
===
'ticket'
?{
total
:
total
,
总游客数
:
total
,
maleCount
:
maleCount
,
男性游客
:
maleCount
,
femaleCount
:
femaleCount
女性游客
:
femaleCount
}
:
{
总会员数
:
total
,
男性会员
:
maleCount
,
女性会员
:
femaleCount
}
}
return
Object
.
entries
(
result
).
map
(([
key
,
value
])
=>
({
key
,
value
}));
return
Object
.
entries
(
result
).
map
(([
key
,
value
])
=>
({
key
,
value
}));
...
...
src/biz/map2/strategies/right/visitorHomeProfileStrategy.ts
View file @
093e6e07
...
@@ -28,18 +28,14 @@ export default class visitorHomeProfileStrategy extends abstractCustomerProfileS
...
@@ -28,18 +28,14 @@ export default class visitorHomeProfileStrategy extends abstractCustomerProfileS
const
scaledCount
=
Math
.
floor
(
count
*
scaleFactor
);
const
scaledCount
=
Math
.
floor
(
count
*
scaleFactor
);
return
{
return
{
key
,
key
,
value
:
{
value
:
scaledCount
count
:
scaledCount
,
percent
:
((
scaledCount
/
total
)
*
100
).
toFixed
(
2
)
+
'%'
}
};
};
});
});
const
currentTotal
=
result
.
reduce
((
sum
,
city
)
=>
sum
+
city
.
value
.
count
,
0
);
const
currentTotal
=
result
.
reduce
((
sum
,
city
)
=>
sum
+
city
.
value
,
0
);
if
(
currentTotal
!==
total
)
{
if
(
currentTotal
!==
total
)
{
const
difference
=
total
-
currentTotal
;
const
difference
=
total
-
currentTotal
;
result
[
0
].
value
.
count
+=
difference
;
result
[
0
].
value
+=
difference
;
result
[
0
].
value
.
percent
=
((
result
[
0
].
value
.
count
/
total
)
*
100
).
toFixed
(
2
)
+
'%'
;
}
}
return
result
;
return
result
;
...
...
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