Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
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
hujun
tl_estate
Commits
f965cf59
Commit
f965cf59
authored
Sep 19, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业绩排名正序倒叙优化
parent
8cc4110a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
18 deletions
+32
-18
PerformanceService.php
application/index/service/PerformanceService.php
+32
-18
No files found.
application/index/service/PerformanceService.php
View file @
f965cf59
...
...
@@ -55,8 +55,8 @@ class PerformanceService
*/
public
function
totalAgent
(
$type
,
$yesterday
,
$end_day
,
$pageNo
,
$pageSize
,
$father_id
,
$params
)
{
$order_
=
$params
[
'order'
];
$where_
=
[];
if
(
$father_id
){
if
(
$type
==
1
){
$where_
[
'store_id'
]
=
$father_id
;
...
...
@@ -109,9 +109,14 @@ class PerformanceService
$num
=
(
$pageNo
-
1
)
*
10
;
foreach
(
$result
as
$key
=>
$value
)
{
switch
(
$type
)
{
case
1
:
$value
[
"index_"
]
=
$key
+
1
+
$num
;
if
(
$order_
==
'desc'
)
{
$value
[
"index_"
]
=
$key
+
1
+
$num
;
}
else
{
$value
[
"index_"
]
=
$total_result
-
$key
-
$num
;
}
$info
=
$this
->
agentModel
->
getAgentsInfoByAgentId
(
$field
,
[
"agent_id"
=>
$value
[
"agent_id"
]
]);
if
(
count
(
$info
)
>
0
)
{
$value
[
"name"
]
=
$info
[
0
][
"name"
];
...
...
@@ -123,7 +128,11 @@ class PerformanceService
}
break
;
case
2
:
$value
[
"index_"
]
=
$key
+
1
+
$num
;
if
(
$order_
==
'desc'
)
{
$value
[
"index_"
]
=
$key
+
1
+
$num
;
}
else
{
$value
[
"index_"
]
=
$total_result
-
$key
-
$num
;
}
$info
=
$this
->
agentModel
->
getAgentsInfoByAgentId
(
$field
,
[
"agent_id"
=>
$value
[
"agent_id"
],
""
]);
$store_name
=
$this
->
agentModel
->
getStoreOrDistrict
([
"store_id"
=>
$value
[
"store_id"
],
"level"
=>
20
]);
if
(
count
(
$info
)
>
0
)
{
...
...
@@ -143,22 +152,27 @@ class PerformanceService
break
;
case
3
:
if
(
$order_
==
'desc'
)
{
$value
[
"index_"
]
=
$key
+
1
+
$num
;
$info
=
$this
->
agentModel
->
getAgentsInfoByAgentId
(
$field
,
[
"agent_id"
=>
$value
[
"agent_id"
]
]);
$district_name
=
$this
->
agentModel
->
getStoreOrDistrict
([
"district_id"
=>
$value
[
"district_id"
],
"level"
=>
[
"in"
,
"30,40"
]
]);
if
(
count
(
$info
)
>
0
)
{
$value
[
"name"
]
=
count
(
$district_name
)
>
0
?
$district_name
[
0
][
"name"
]
:
"---"
;
$value
[
"img"
]
=
AGENTHEADERIMGURL
.
$district_name
[
0
][
"img"
];
$value
[
"store_name"
]
=
$info
[
0
][
"store_name"
];
$value
[
"district_name"
]
=
$info
[
0
][
"district_name"
];
}
//计算区域人数
$params
=
[];
$params
[
'district_id'
]
=
$value
[
"district_id"
];
$params
[
"status"
]
=
0
;
//只查询正常状态的经纪人
$value
[
"team_num"
]
=
$this
->
agentModel
->
getAgentsCountByStoreId
(
$params
);
}
else
{
$value
[
"index_"
]
=
$total_result
-
$key
-
$num
;
}
$info
=
$this
->
agentModel
->
getAgentsInfoByAgentId
(
$field
,
[
"agent_id"
=>
$value
[
"agent_id"
]
]);
$district_name
=
$this
->
agentModel
->
getStoreOrDistrict
([
"district_id"
=>
$value
[
"district_id"
],
"level"
=>
[
"in"
,
"30,40"
]
]);
if
(
count
(
$info
)
>
0
)
{
$value
[
"name"
]
=
count
(
$district_name
)
>
0
?
$district_name
[
0
][
"name"
]
:
"---"
;
$value
[
"img"
]
=
AGENTHEADERIMGURL
.
$district_name
[
0
][
"img"
];
$value
[
"store_name"
]
=
$info
[
0
][
"store_name"
];
$value
[
"district_name"
]
=
$info
[
0
][
"district_name"
];
}
array_push
(
$arr
,
$value
);
//计算区域人数
$params_
=
[];
$params_
[
'district_id'
]
=
$value
[
"district_id"
];
$params_
[
"status"
]
=
0
;
//只查询正常状态的经纪人
$value
[
"team_num"
]
=
$this
->
agentModel
->
getAgentsCountByStoreId
(
$params_
);
array_push
(
$arr
,
$value
);
break
;
}
}
...
...
@@ -183,7 +197,7 @@ class PerformanceService
* @param string $agent_id
* @return int]
*/
public
function
getRanking
(
$type
,
$yesterday
,
$end_day
,
$pageNo
,
$pageSize
,
$params
,
$agent_id
=
'5740'
)
public
function
getRanking
(
$type
,
$yesterday
,
$end_day
,
$pageNo
,
$pageSize
,
$params
,
$agent_id
)
{
$where_
=
[];
...
...
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