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
f80c8f82
Commit
f80c8f82
authored
Dec 14, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
计算业绩总计 即应分佣金 根据分佣ID去重
parent
52a9bbed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
11 deletions
+96
-11
ImageDepot.php
application/index/controller/ImageDepot.php
+36
-8
PerformanceInfo.php
application/index/controller/PerformanceInfo.php
+41
-3
OBargainModel.php
application/model/OBargainModel.php
+19
-0
No files found.
application/index/controller/ImageDepot.php
View file @
f80c8f82
...
@@ -175,14 +175,42 @@ class ImageDepot extends Basic
...
@@ -175,14 +175,42 @@ class ImageDepot extends Basic
public
function
ceshi
(){
public
function
ceshi
(){
//查询客户是否在保护期内
//判断客户是否超过24小时保护期间 0:保护器内 1:超过保护期
$records
=
array
(
$vip_services
=
new
VipService
();
array
(
//是否可以查看vip客户 0:可查看 1:不可查看
'bargain_id'
=>
2135
,
$agent_id
=
51
;
'scale_fee'
=>
12
,
$group_id
=
'2,3,4,5'
;
),
$res
=
$vip_services
->
getGroup
(
$agent_id
,
$group_id
);
array
(
dump
(
$res
);
'bargain_id'
=>
2135
,
'scale_fee'
=>
12
,
),
array
(
'bargain_id'
=>
2135
,
'scale_fee'
=>
12
,
),
array
(
'bargain_id'
=>
5623
,
'scale_fee'
=>
12
,
)
);
$first_names
=
$this
->
arr_unset
(
$records
,
'bargain_id'
);
dump
(
$first_names
);
}
//对一个二维数组的某个键进行去重
private
function
arr_unset
(
$arr
,
$key
){
$res
=
array
();
foreach
(
$arr
as
$value
)
{
if
(
isset
(
$res
[
$value
[
$key
]])){
//查看有没有重复项
unset
(
$value
[
$key
]);
//有:销毁
}
else
{
$res
[
$value
[
$key
]]
=
$value
;
}
}
return
$res
;
}
}
}
}
...
...
application/index/controller/PerformanceInfo.php
View file @
f80c8f82
...
@@ -121,9 +121,24 @@ class PerformanceInfo extends Basic
...
@@ -121,9 +121,24 @@ class PerformanceInfo extends Basic
}
}
$return_total
=
$this
->
oBargainModel
->
performancelInfoTotal
(
$where
,
$field
);
$return_total
=
$this
->
oBargainModel
->
performancelInfoTotal
(
$where
,
$field
);
$field
=
'sum(Obargain.scale_fee) as scale_fee_sum'
;
$return_sum
=
$this
->
oBargainModel
->
performancelInfo
(
$where
,
$field
,
$pageSize
,
$pageNo
);
/*计算业绩总计 即应分佣金 根据分佣ID去重*/
return
$this
->
response
(
200
,
''
,
[
'scale_fee_sum'
=>
$return_sum
[
0
][
'scale_fee_sum'
],
'data'
=>
$return
,
'total'
=>
$return_total
]);
$field
=
'Obargain.scale_fee,Obargain.id,Obargain.father_id'
;
$return_sum
=
$this
->
oBargainModel
->
performancelInfoScaleFee
(
$where
,
$field
);
foreach
(
$return_sum
as
$key1
=>
$val1
)
{
//成交报告ID
$return_sum
[
$key1
][
'bargain_id'
]
=
$val1
[
"father_id"
]
==
0
?
$val1
[
"id"
]
:
$val1
[
"father_id"
];
//分佣ID
$return_sum
[
$key1
][
'commission_id'
]
=
$val1
[
"id"
]
;
}
$return_sum_unique
=
$this
->
arr_unset
(
$return_sum
,
'commission_id'
);
$return_sum
=
0
;
foreach
(
$return_sum_unique
as
$key12
=>
$val2
)
{
$return_sum
+=
$val2
[
"scale_fee"
];
}
/*计算业绩总计 即应分佣金 根据分佣ID去重*/
return
$this
->
response
(
200
,
''
,
[
'scale_fee_sum'
=>
$return_sum
,
'data'
=>
$return
,
'total'
=>
$return_total
]);
}
else
{
}
else
{
return
view
(
'performanceInfo'
);
return
view
(
'performanceInfo'
);
}
}
...
@@ -253,6 +268,28 @@ class PerformanceInfo extends Basic
...
@@ -253,6 +268,28 @@ class PerformanceInfo extends Basic
}
}
//对一个二维数组的某个键进行去重
private
function
arr_unset
(
$arr
,
$key
){
$res
=
array
();
foreach
(
$arr
as
$value
)
{
if
(
isset
(
$res
[
$value
[
$key
]])){
//查看有没有重复项
unset
(
$value
[
$key
]);
//有:销毁
}
else
{
$res
[
$value
[
$key
]]
=
$value
;
}
}
return
$res
;
}
}
}
\ No newline at end of file
application/model/OBargainModel.php
View file @
f80c8f82
...
@@ -1413,6 +1413,25 @@ class OBargainModel extends Model
...
@@ -1413,6 +1413,25 @@ class OBargainModel extends Model
return
$result
;
return
$result
;
}
}
public
function
performancelInfoScaleFee
(
$where
,
$filed
)
{
$result
=
$this
->
db_
->
field
(
$filed
)
->
alias
(
"Obargain"
)
->
join
(
"o_report Oreport"
,
"Obargain.report_id = Oreport.id"
,
"left"
)
->
join
(
"o_order Oorder"
,
"Obargain.order_id = Oorder.id"
,
"left"
)
->
join
(
"g_houses Houses"
,
"Oorder.house_id = Houses.id"
,
"left"
)
->
join
(
"a_agents Agent"
,
"Obargain.agent_id = Agent.id"
,
"left"
)
->
join
(
'a_store Store'
,
'Agent.store_id = Store.id'
,
'left'
)
->
join
(
'a_district District'
,
'Agent.district_id = District.id'
,
'left'
)
->
join
(
'o_partial_commission PartialCommission'
,
'PartialCommission.bargain_id = Obargain.id'
,
'left'
)
->
where
(
$where
)
->
order
(
"Obargain.create_time desc"
)
->
select
();
//echo $this->db_->getLastSql();
return
$result
;
}
public
function
performancelInfoExcel
(
$where
,
$filed
)
public
function
performancelInfoExcel
(
$where
,
$filed
)
{
{
$result
=
$this
->
db_
$result
=
$this
->
db_
...
...
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