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
c71c7650
Commit
c71c7650
authored
Oct 12, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业绩总和
parent
56664fc8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
1 deletion
+42
-1
Performance.php
application/index/controller/Performance.php
+5
-0
PerformanceService.php
application/index/service/PerformanceService.php
+11
-1
TAgentTotalModel.php
application/model/TAgentTotalModel.php
+26
-0
No files found.
application/index/controller/Performance.php
View file @
c71c7650
...
...
@@ -60,6 +60,7 @@ class Performance extends Basic
if
(
count
(
$list
)
>
0
)
{
$result
[
"list"
]
=
$list
[
'list'
];
$result
[
"total"
]
=
$list
[
'total'
];
$result
[
"performance_total"
]
=
$list
[
'performance_total'
];
$result
[
"start_time"
]
=
$start_day
;
$result
[
"end_time"
]
=
$end_day
;
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
...
...
@@ -103,6 +104,8 @@ class Performance extends Basic
if
(
count
(
$list
)
>
0
)
{
$result
[
"list"
]
=
$list
[
'list'
];
$result
[
"total"
]
=
$list
[
'total'
];
$result
[
"performance_total"
]
=
$list
[
'performance_total'
];
$result
[
"start_time"
]
=
$start_day
;
$result
[
"end_time"
]
=
$end_day
;
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
...
...
@@ -150,6 +153,8 @@ class Performance extends Basic
if
(
count
(
$list
)
>
0
)
{
$result
[
"list"
]
=
$list
[
'list'
];
$result
[
"total"
]
=
$list
[
'total'
];
$result
[
"performance_total"
]
=
$list
[
'performance_total'
];
$result
[
"start_time"
]
=
$start_day
;
$result
[
"end_time"
]
=
$end_day
;
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
...
...
application/index/service/PerformanceService.php
View file @
c71c7650
...
...
@@ -104,6 +104,16 @@ class PerformanceService
$result
=
$this
->
totalModel
->
getTotalByAgentIdForPcPerformance
(
$field
,
$where_
,
$type
,
$order
,
$pageSize
,
$pageNo
);
$total_result
=
$this
->
totalModel
->
getTotalByAgentIdForPcPerformanceTotal
(
$field
,
$where_
,
$type
);
/*计算总业绩*/
$field
=
"sum(performance) as performance_total"
;
$sum_result
=
$this
->
totalModel
->
getTotalByAgentIdForPcPerformanceSum
(
$field
,
$where_
,
$type
);
$sum_result_num
=
0
;
foreach
(
$sum_result
as
$k1
=>
$v1
)
{
$sum_result_num
+=
$v1
[
'performance_total'
];
}
/*计算总业绩 end*/
$arr
=
[];
$field
=
"a.name,a.img,b.store_name,c.district_name"
;
...
...
@@ -184,7 +194,7 @@ class PerformanceService
$ranking_num
=
$this
->
getRanking
(
$type
,
$yesterday
,
$end_day
,
$pageNo
,
$pageSize
,
$params
,
$agent_id
);
$arr
[
0
][
'index_'
]
=
$ranking_num
;
}
return
[
'list'
=>
$arr
,
'total'
=>
$total_result
];
return
[
'list'
=>
$arr
,
'total'
=>
$total_result
,
'performance_total'
=>
$sum_result_num
];
}
/**
...
...
application/model/TAgentTotalModel.php
View file @
c71c7650
...
...
@@ -246,4 +246,29 @@ class TAgentTotalModel extends Model
return
$result
;
}
public
function
getTotalByAgentIdForPcPerformanceSum
(
$field
,
$params
,
$type
,
$order
=
""
)
{
$group_
=
""
;
switch
(
$type
)
{
case
1
:
$group_
=
"agent_id"
;
break
;
case
2
:
$group_
=
"store_id"
;
break
;
case
3
:
$group_
=
"district_id"
;
break
;
}
$result
=
$this
->
db_
->
field
(
$field
)
->
where
(
$params
)
->
group
(
$group_
)
->
select
();
//echo $this->db_->getLastSql();
return
$result
;
}
}
\ No newline at end of file
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