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
3eb736bc
Commit
3eb736bc
authored
Oct 23, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业绩修改
parent
7b751f43
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
33 deletions
+46
-33
PerformanceService.php
application/index/service/PerformanceService.php
+41
-30
TAgentTotalModel.php
application/model/TAgentTotalModel.php
+5
-3
No files found.
application/index/service/PerformanceService.php
View file @
3eb736bc
...
@@ -60,26 +60,28 @@ class PerformanceService
...
@@ -60,26 +60,28 @@ class PerformanceService
$where_
=
[];
$where_
=
[];
if
(
$father_id
){
if
(
$father_id
){
if
(
$type
==
1
){
if
(
$type
==
1
){
$where_
[
'store_id'
]
=
$father_id
;
$where_
[
'
a.
store_id'
]
=
$father_id
;
}
elseif
(
$type
==
2
){
}
elseif
(
$type
==
2
){
$where_
[
'district_id'
]
=
$father_id
;
$where_
[
'
a.
district_id'
]
=
$father_id
;
}
}
}
}
if
(
!
empty
(
$params
[
'site_id'
]))
{
$where_
[
'd.site_id'
]
=
$params
[
'site_id'
];
}
//区域搜索条件
//区域搜索条件
if
(
!
empty
(
$params
[
'district_id'
]))
{
if
(
!
empty
(
$params
[
'district_id'
]))
{
$where_
[
'district_id'
]
=
$params
[
'district_id'
];
$where_
[
'
a.
district_id'
]
=
$params
[
'district_id'
];
}
}
//部门搜索条件
//部门搜索条件
if
(
!
empty
(
$params
[
'store_id'
]))
{
if
(
!
empty
(
$params
[
'store_id'
]))
{
$where_
[
'store_id'
]
=
$params
[
'store_id'
];
$where_
[
'
a.
store_id'
]
=
$params
[
'store_id'
];
}
}
//经纪人搜索条件
//经纪人搜索条件
if
(
!
empty
(
$params
[
'agent_id'
]))
{
if
(
!
empty
(
$params
[
'agent_id'
]))
{
$where_
[
'agent_id'
]
=
$params
[
'agent_id'
];
$where_
[
'a
.a
gent_id'
]
=
$params
[
'agent_id'
];
}
}
$where_
[
'total_time'
]
=
array
(
'between'
,
array
(
$end_day
,
$yesterday
)
);
$where_
[
'
a.
total_time'
]
=
array
(
'between'
,
array
(
$end_day
,
$yesterday
)
);
/* 成交报告数 bargain_sum
/* 成交报告数 bargain_sum
收款数 paylog
收款数 paylog
...
@@ -89,14 +91,14 @@ class PerformanceService
...
@@ -89,14 +91,14 @@ class PerformanceService
新增客户数 add_user_num
新增客户数 add_user_num
团队人数 team_num*/
团队人数 team_num*/
$field
=
"a
gent_id,store_id,
district_id,
$field
=
"a
.agent_id,a.store_id,a.
district_id,
sum(performance) as performance_total,
sum(
a.
performance) as performance_total,
sum(bargain_sum) as bargain_sum_total,
sum(
a.
bargain_sum) as bargain_sum_total,
sum(paylog) as paylog_total,
sum(
a.
paylog) as paylog_total,
sum(march_in_num) as march_in_num_total,
sum(
a.
march_in_num) as march_in_num_total,
sum(look_at_num) as look_at_num_total,
sum(
a.
look_at_num) as look_at_num_total,
sum(add_house_num) as add_house_num_total,
sum(a
.a
dd_house_num) as add_house_num_total,
sum(add_user_num) as add_user_num_total
sum(a
.a
dd_user_num) as add_user_num_total
"
;
"
;
//排序规则
//排序规则
...
@@ -325,26 +327,35 @@ class PerformanceService
...
@@ -325,26 +327,35 @@ class PerformanceService
$where_
=
[];
$where_
=
[];
if
(
$father_id
){
if
(
$father_id
){
if
(
$type
==
1
){
if
(
$type
==
1
){
$where_
[
'store_id'
]
=
$father_id
;
$where_
[
'
a.
store_id'
]
=
$father_id
;
}
elseif
(
$type
==
2
){
}
elseif
(
$type
==
2
){
$where_
[
'district_id'
]
=
$father_id
;
$where_
[
'a.district_id'
]
=
$father_id
;
}
}
}
if
(
!
empty
(
$params
[
'district_id'
]))
{
$where_
[
'a.district_id'
]
=
$params
[
'district_id'
];
}
}
if
(
!
empty
(
$params
[
'site_id'
]))
{
$where_
[
'd.site_id'
]
=
$params
[
'site_id'
];
}
//区域搜索条件
//区域搜索条件
if
(
!
empty
(
$params
[
'district_id'
]))
{
if
(
!
empty
(
$params
[
'district_id'
]))
{
$where_
[
'district_id'
]
=
$params
[
'district_id'
];
$where_
[
'
a.
district_id'
]
=
$params
[
'district_id'
];
}
}
//部门搜索条件
//部门搜索条件
if
(
!
empty
(
$params
[
'store_id'
]))
{
if
(
!
empty
(
$params
[
'store_id'
]))
{
$where_
[
'store_id'
]
=
$params
[
'store_id'
];
$where_
[
'
a.
store_id'
]
=
$params
[
'store_id'
];
}
}
//经纪人搜索条件
//经纪人搜索条件
if
(
!
empty
(
$params
[
'agent_id'
]))
{
if
(
!
empty
(
$params
[
'agent_id'
]))
{
$where_
[
'agent_id'
]
=
$params
[
'agent_id'
];
$where_
[
'a
.a
gent_id'
]
=
$params
[
'agent_id'
];
}
}
$where_
[
'total_time'
]
=
array
(
'between'
,
array
(
$end_day
,
$yesterday
)
);
$where_
[
'
a.
total_time'
]
=
array
(
'between'
,
array
(
$end_day
,
$yesterday
)
);
/* 成交报告数 bargain_sum
/* 成交报告数 bargain_sum
收款数 paylog
收款数 paylog
...
@@ -354,18 +365,18 @@ class PerformanceService
...
@@ -354,18 +365,18 @@ class PerformanceService
新增客户数 add_user_num
新增客户数 add_user_num
团队人数 team_num*/
团队人数 team_num*/
$field
=
"a
gent_id,store_id,
district_id,
$field
=
"a
.agent_id,a.store_id,a.
district_id,
sum(performance) as performance_total,
sum(
a.
performance) as performance_total,
sum(bargain_sum) as bargain_sum_total,
sum(
a.
bargain_sum) as bargain_sum_total,
sum(paylog) as paylog_total,
sum(
a.
paylog) as paylog_total,
sum(march_in_num) as march_in_num_total,
sum(
a.
march_in_num) as march_in_num_total,
sum(look_at_num) as look_at_num_total,
sum(
a.
look_at_num) as look_at_num_total,
sum(add_house_num) as add_house_num_total,
sum(a
.a
dd_house_num) as add_house_num_total,
sum(add_user_num) as add_user_num_total
sum(a
.a
dd_user_num) as add_user_num_total
"
;
"
;
$order
=
"performance_total desc"
;
$order
=
"performance_total desc"
;
$result
=
$this
->
totalModel
->
getTotalByAgentId
(
$field
,
$where_
,
$type
,
$order
);
$result
=
$this
->
totalModel
->
getTotalByAgentId
Site
(
$field
,
$where_
,
$type
,
$order
);
$arr
=
[];
$arr
=
[];
$field
=
"a.name,a.img,b.store_name,c.district_name"
;
$field
=
"a.name,a.img,b.store_name,c.district_name"
;
...
...
application/model/TAgentTotalModel.php
View file @
3eb736bc
...
@@ -227,18 +227,20 @@ class TAgentTotalModel extends Model
...
@@ -227,18 +227,20 @@ class TAgentTotalModel extends Model
$group_
=
""
;
$group_
=
""
;
switch
(
$type
)
{
switch
(
$type
)
{
case
1
:
case
1
:
$group_
=
"agent_id"
;
$group_
=
"a
.a
gent_id"
;
break
;
break
;
case
2
:
case
2
:
$group_
=
"store_id"
;
$group_
=
"
a.
store_id"
;
break
;
break
;
case
3
:
case
3
:
$group_
=
"district_id"
;
$group_
=
"
a.
district_id"
;
break
;
break
;
}
}
$result
=
$this
->
db_
$result
=
$this
->
db_
->
field
(
$field
)
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'a_district d'
,
'a.district_id = d.id'
,
'left'
)
->
where
(
$params
)
->
where
(
$params
)
->
group
(
$group_
)
->
group
(
$group_
)
->
order
(
$order
)
->
order
(
$order
)
...
...
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