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
84c72911
Commit
84c72911
authored
Dec 03, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分区业绩杭州
parent
233d835b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
RankingList.php
application/index/controller/RankingList.php
+2
-2
RankingListService.php
application/index/service/RankingListService.php
+17
-10
No files found.
application/index/controller/RankingList.php
View file @
84c72911
...
@@ -31,8 +31,8 @@ class RankingList extends Basic{
...
@@ -31,8 +31,8 @@ class RankingList extends Basic{
*/
*/
public
function
getRandKingList
(){
public
function
getRandKingList
(){
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/*
$params["position"] = 1;//职称 1店长 2经理 3主任 4顾问 0新人
$params
[
"position"
]
=
1
;
//职称 1店长 2经理 3主任 4顾问 0新人
$this->siteId = 1000
1;*/
$this
->
siteId
=
1000
2
;
if
(
!
isset
(
$params
[
"position"
])
||
$params
[
"position"
]
<
0
||
$params
[
"position"
]
>
5
){
if
(
!
isset
(
$params
[
"position"
])
||
$params
[
"position"
]
<
0
||
$params
[
"position"
]
>
5
){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
}
...
...
application/index/service/RankingListService.php
View file @
84c72911
...
@@ -26,8 +26,14 @@ class RankingListService
...
@@ -26,8 +26,14 @@ class RankingListService
{
{
$this
->
agentModel
=
new
AAgents
();
$this
->
agentModel
=
new
AAgents
();
$this
->
agentTotalModel
=
new
TAgentTotalModel
();
$this
->
agentTotalModel
=
new
TAgentTotalModel
();
$this
->
crewNum
=
20
;
$this
->
crewNum
=
array
(
$this
->
crewNumMax
=
25
;
"10001"
=>
20
,
"10002"
=>
8
);
$this
->
crewNumMax
=
array
(
"10001"
=>
25
,
"10002"
=>
10
);
}
}
...
@@ -54,7 +60,7 @@ class RankingListService
...
@@ -54,7 +60,7 @@ class RankingListService
}
}
//分组
//分组
$result
=
$this
->
group
(
$resultArr
);
$result
=
$this
->
group
(
$resultArr
,
$siteId
);
//循环分组后的数组,查询出各组本月业绩排行
//循环分组后的数组,查询出各组本月业绩排行
//本月
//本月
...
@@ -82,20 +88,21 @@ class RankingListService
...
@@ -82,20 +88,21 @@ class RankingListService
/**
/**
* @param $resultArr
* @param $resultArr
* @param $siteId
* @return array
* @return array
*/
*/
private
function
group
(
$resultArr
){
private
function
group
(
$resultArr
,
$siteId
){
//分组
//分组
$total
=
count
(
$resultArr
);
$total
=
count
(
$resultArr
);
$total_page
=
floor
(
$total
/
$this
->
crewNum
);
$total_page
=
floor
(
$total
/
$this
->
crewNum
[
$siteId
]
);
$residue
=
$total
%
$this
->
crewNum
;
$residue
=
$total
%
$this
->
crewNum
[
$siteId
]
;
$full
=
$total_page
*
(
$this
->
crewNumMax
-
$this
->
crewNum
);
$full
=
$total_page
*
(
$this
->
crewNumMax
[
$siteId
]
-
$this
->
crewNum
[
$siteId
]
);
$x
=
$this
->
crewNum
;
$x
=
$this
->
crewNum
[
$siteId
]
;
$y
=
$total_page
;
$y
=
$total_page
;
if
(
$full
<
$residue
)
{
if
(
$full
<
$residue
)
{
$y
=
$y
+
1
;
$y
=
$y
+
1
;
}
else
{
}
else
{
$x
=
ceil
(
$residue
/
$total_page
)
+
$this
->
crewNum
;
$x
=
ceil
(
$residue
/
$total_page
)
+
$this
->
crewNum
[
$siteId
]
;
}
}
$result
=
[];
$result
=
[];
$i
=
0
;
$i
=
0
;
...
@@ -142,7 +149,7 @@ class RankingListService
...
@@ -142,7 +149,7 @@ class RankingListService
}
}
//分组
//分组
$result
=
$this
->
group
(
$resultArr
);
$result
=
$this
->
group
(
$resultArr
,
$siteId
);
//循环分组后的数组,查询出各组本月业绩排行
//循环分组后的数组,查询出各组本月业绩排行
//本月
//本月
...
...
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