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
20b51003
Commit
20b51003
authored
Sep 27, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实收总计
parent
b273e63b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
6 deletions
+31
-6
Finance.php
application/index/controller/Finance.php
+16
-6
OPartialCommission.php
application/model/OPartialCommission.php
+15
-0
No files found.
application/index/controller/Finance.php
View file @
20b51003
...
...
@@ -716,12 +716,8 @@ class Finance extends Basic
$where
[
'd.internal_address'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'internal_address'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'phone'
]))
{
$where
[
'e.phone'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'phone'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'name'
]))
{
$where
[
'e.name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'name'
]
.
'%'
];
if
(
!
empty
(
$this
->
params
[
'partial_id'
]))
{
$where
[
'e.id'
]
=
$this
->
params
[
'partial_id'
];
}
if
(
!
empty
(
$this
->
params
[
'house_number'
]))
{
...
...
@@ -732,12 +728,26 @@ class Finance extends Basic
$where
[]
=
[
'EXP'
,
'b.id ='
.
$this
->
params
[
'bargain_id'
]
.
' or father_id='
.
$this
->
params
[
'bargain_id'
]
];
}
if
(
!
empty
(
$this
->
params
[
'store_id'
]))
{
$where
[
'e.store_id'
]
=
$this
->
params
[
'store_id'
];
}
if
(
!
empty
(
$this
->
params
[
'district_id'
]))
{
$where
[
'e.district_id'
]
=
$this
->
params
[
'district_id'
];
}
$field
=
'a.id,b.id as bargain_id,f.income_time,a.practical_fee,b.scale_fee,d.internal_address,b.agent_id,b.house_number,b.father_id,b.order_id,a.real_income_id'
;
$m_commission
=
new
OPartialCommission
();
try
{
$data
[
'data'
][
'list'
]
=
$m_commission
->
getCommissionBargainList
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$field
,
$where
);
$data
[
'data'
][
'total'
]
=
$m_commission
->
getCommissionBargainListTotal
(
$where
);
if
(
!
empty
(
$where
))
{
$data
[
'data'
][
'total_money'
]
=
$m_commission
->
totalMoney
(
$where
);
//实收总计
}
else
{
$data
[
'data'
][
'total_money'
]
=
''
;
}
}
catch
(
\Exception
$e
)
{
return
$this
->
response
(
101
,
'内部错误,获取分佣提成明细列表失败!请联系运营。'
.
$e
->
getMessage
());
}
...
...
application/model/OPartialCommission.php
View file @
20b51003
...
...
@@ -84,6 +84,21 @@ class OPartialCommission extends BaseModel
return
$result
;
}
/**
* @param $where
* @return float|int
*/
public
function
totalMoney
(
$where
)
{
return
$this
->
alias
(
'a'
)
->
join
(
'o_bargain b'
,
'a.bargain_id = b.id'
,
'left'
)
->
join
(
'o_order c'
,
'b.order_id = c.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
join
(
'a_agents e'
,
'b.agent_id = e.id'
,
'left'
)
->
join
(
'o_real_income f'
,
'a.real_income_id = f.id'
,
'left'
)
->
where
(
$where
)
->
sum
(
'a.practical_fee'
);
}
/**
* 导出列表
*
...
...
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