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
671dff42
Commit
671dff42
authored
Nov 21, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实收导出增加字段
parent
dc266c4a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
25 deletions
+59
-25
Finance.php
application/index/controller/Finance.php
+50
-4
OPartialCommission.php
application/model/OPartialCommission.php
+9
-21
No files found.
application/index/controller/Finance.php
View file @
671dff42
...
...
@@ -913,18 +913,64 @@ class Finance extends Basic
$where
[
'e.id'
]
=
$this
->
params
[
'partial_id'
];
}
$field
=
'a.id,a.confirm_date,a.practical_fee,b.scale_fee,d.internal_address,b.agent_id,cash,service_charge,charity_fund,real_fee,a.real_income_id,a.should_commission'
;
$field
=
'a.id,a.confirm_date,a.practical_fee,b.scale_fee,
b.scale,b.role,
d.internal_address,b.agent_id,cash,service_charge,charity_fund,real_fee,a.real_income_id,a.should_commission'
;
$m_commission
=
new
OPartialCommission
();
try
{
$data
=
$m_commission
->
getCommissionBargainColumn
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$field
,
$where
);
$m_agent
=
new
AAgents
();
$m_real
=
new
ORealIncome
();
$fields_str
=
'a.id,a.name,a.phone,b.store_name,c.district_name'
;
$result
=
[];
foreach
(
$data
as
$k
=>
$v
)
{
$result
[
$k
][
'income_time'
]
=
$m_real
->
where
(
'id'
,
$v
[
'real_income_id'
])
->
value
(
'income_time'
);
if
(
$v
[
'agent_id'
])
{
$agent_data
=
$m_agent
->
getStoreDistrict
(
$fields_str
,
[
'a.id'
=>
$v
[
'agent_id'
]
]);
$result
[
$k
][
'district_store'
]
=
$agent_data
[
'store_name'
]
.
'-'
.
$agent_data
[
'store_name'
];
$result
[
$k
][
'agent'
]
=
$agent_data
[
'name'
]
.
'-'
.
$agent_data
[
'phone'
];
}
switch
(
$v
[
'role'
])
{
case
1
:
$result
[
$k
][
'role'
]
=
'盘方'
;
break
;
case
2
:
$result
[
$k
][
'role'
]
=
'客方'
;
break
;
case
3
:
$result
[
$k
][
'role'
]
=
'反签'
;
break
;
case
4
:
$result
[
$k
][
'role'
]
=
'独家'
;
break
;
case
5
:
$result
[
$k
][
'role'
]
=
'合作方'
;
break
;
case
6
:
$result
[
$k
][
'role'
]
=
'APP盘下载方'
;
break
;
case
7
:
$result
[
$k
][
'role'
]
=
'APP客下载方'
;
break
;
default
:
$result
[
$k
][
'role'
]
=
'未定义'
;
}
$result
[
$k
][
'scale'
]
=
$v
[
'scale'
];
$result
[
$k
][
'should_commission'
]
=
$v
[
'should_commission'
];
$result
[
$k
][
'real_fee'
]
=
$v
[
'real_fee'
];
$result
[
$k
][
'service_charge'
]
=
$v
[
'service_charge'
];
$result
[
$k
][
'charity_fund'
]
=
$v
[
'charity_fund'
];
$result
[
$k
][
'cash'
]
=
$v
[
'cash'
];
$result
[
$k
][
'practical_fee'
]
=
$v
[
'practical_fee'
];
}
}
catch
(
\Exception
$e
)
{
return
'<script>alert("导出分佣提成明细列表失败");window.close();</script>'
;
}
$export
=
new
ExportExcelUntil
();
$title
=
[
'收佣日期'
,
'所属部门/门店'
,
'业务员'
,
'应分佣金(元)'
,
'预分佣金(元)'
,
'手续费(元)'
,
'慈善基金(元)'
,
'现金奖(元)'
,
'实收佣金(元)'
];
$export
->
exportTable
(
'实收明细表'
,
$
data
,
8
,
'实收明细表'
,
$title
);
$title
=
[
'收佣日期'
,
'所属部门/门店'
,
'业务员'
,
'分佣角色'
,
'分佣比例(%)'
,
'应分佣金(元)'
,
'预分佣金(元)'
,
'手续费(元)'
,
'慈善基金(元)'
,
'现金奖(元)'
,
'实收佣金(元)'
];
$export
->
exportTable
(
'实收明细表'
,
$
result
,
10
,
'实收明细表'
,
$title
);
return
''
;
}
...
...
application/model/OPartialCommission.php
View file @
671dff42
...
...
@@ -88,6 +88,14 @@ class OPartialCommission extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
/**
* @param $pageNo
* @param $pageSize
* @param string $order_
* @param $fields
* @param $where
* @return array
*/
public
function
getCommissionBargainColumn
(
$pageNo
,
$pageSize
,
$order_
=
'id desc'
,
$fields
,
$where
)
{
$data
=
$this
->
alias
(
'a'
)
...
...
@@ -101,27 +109,7 @@ class OPartialCommission extends BaseModel
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
column
(
$fields
);
$result
=
[];
$m_agent
=
new
AAgents
();
$m_real
=
new
ORealIncome
();
$fields_str
=
'a.id,a.name,a.phone,b.store_name,c.district_name'
;
foreach
(
$data
as
$k
=>
$v
)
{
$result
[
$k
][
'income_time'
]
=
$m_real
->
where
(
'id'
,
$v
[
'real_income_id'
])
->
value
(
'income_time'
);
if
(
$v
[
'agent_id'
])
{
$agent_data
=
$m_agent
->
getStoreDistrict
(
$fields_str
,
[
'a.id'
=>
$v
[
'agent_id'
]
]);
$result
[
$k
][
'district_store'
]
=
$agent_data
[
'store_name'
]
.
'-'
.
$agent_data
[
'store_name'
];
$result
[
$k
][
'agent'
]
=
$agent_data
[
'name'
]
.
'-'
.
$agent_data
[
'phone'
];
}
$result
[
$k
][
'should_commission'
]
=
$v
[
'should_commission'
];
$result
[
$k
][
'real_fee'
]
=
$v
[
'real_fee'
];
$result
[
$k
][
'service_charge'
]
=
$v
[
'service_charge'
];
$result
[
$k
][
'charity_fund'
]
=
$v
[
'charity_fund'
];
$result
[
$k
][
'cash'
]
=
$v
[
'cash'
];
$result
[
$k
][
'practical_fee'
]
=
$v
[
'practical_fee'
];
}
return
$result
;
return
$data
;
}
/**
...
...
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