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
d3a4c59e
Commit
d3a4c59e
authored
Sep 19, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pc后台业绩分页
parent
4c12a67b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
2 deletions
+67
-2
PerformanceService.php
application/index/service/PerformanceService.php
+3
-2
TAgentTotalModel.php
application/model/TAgentTotalModel.php
+64
-0
No files found.
application/index/service/PerformanceService.php
View file @
d3a4c59e
...
...
@@ -85,7 +85,8 @@ class PerformanceService
"
;
$order
=
"performance_total desc"
;
$result
=
$this
->
totalModel
->
getTotalByAgentId
(
$field
,
$where_
,
$type
,
$order
);
$result
=
$this
->
totalModel
->
getTotalByAgentIdForPcPerformance
(
$field
,
$where_
,
$type
,
$order
,
$pageSize
,
$pageNo
);
$total_result
=
$this
->
totalModel
->
getTotalByAgentIdForPcPerformanceTotal
(
$field
,
$where_
,
$type
);
$arr
=
[];
$field
=
"a.name,a.img,b.store_name,c.district_name"
;
...
...
@@ -144,7 +145,7 @@ class PerformanceService
}
}
//dump($arr);exit;
return
[
'list'
=>
$arr
,
'total'
=>
0
];
return
[
'list'
=>
$arr
,
'total'
=>
$total_result
];
}
...
...
application/model/TAgentTotalModel.php
View file @
d3a4c59e
...
...
@@ -183,4 +183,67 @@ class TAgentTotalModel extends Model
->
where
(
$param
)
->
select
();
}
/**
* 获取分组统计数据-pc后台业绩用
* @param $field
* @param $params
* @param $type
* @param string $order
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getTotalByAgentIdForPcPerformance
(
$field
,
$params
,
$type
,
$order
=
""
,
$pageSize
,
$pageNo
)
{
$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_
)
->
order
(
$order
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
//echo $this->db_->getLastSql();
return
$result
;
}
public
function
getTotalByAgentIdForPcPerformanceTotal
(
$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_
)
->
count
();
//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