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
81cdb40c
Commit
81cdb40c
authored
Mar 27, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导出修改
parent
ca694e6e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
31 deletions
+48
-31
Finance.php
application/index/controller/Finance.php
+48
-31
No files found.
application/index/controller/Finance.php
View file @
81cdb40c
...
...
@@ -3076,7 +3076,7 @@ class Finance extends Basic
* 收款记录 Excel
*/
public
function
getCollectionExcel
()
{
set_time_limit
(
0
);
$pageNo
=
1
;
$pageSize
=
10000
;
$data
=
[];
...
...
@@ -3189,19 +3189,15 @@ class Finance extends Basic
if
(
!
empty
(
$this
->
params
[
'bargain_id'
]))
{
$where
[
'a.bargain_id'
]
=
$this
->
params
[
'bargain_id'
];
}
try
{
//
try {
$order
=
new
OPayLogModel
();
if
(
empty
(
$this
->
params
[
'excel'
]))
{
$field
=
'a.id,a.create_time,a.order_id,a.father_id,a.money,a.real_money,a.pay_type,a.type,a.source,a.transaction_fee,a.source,b.f_id,a.transfer_name,a.receipt_number,'
;
$field
=
'a.id,a.create_time,a.order_id,a.father_id,a.money,a.real_money,a.pay_type,a.type,a.source,a.transaction_fee,a.source,b.f_id,a.transfer_name,a.receipt_number,
a.bargain_id,
'
;
$field
.=
'e.name,a.income_time,e.store_id,b.house_id,b.order_no,a.report_id,a.house_number,a.is_dividend,a.last_transfer_time,a.industry_type,a.agent_id,d.internal_address as address,e.name as agent_name'
;
$list
=
$order
->
getAddPayLogOrderListLimit
(
$pageNo
,
$pageSize
,
$order_
=
'a.id desc'
,
$field
,
$where
);
$data
[
'total'
]
=
$order
->
getAddPayLogOrderListLimitTotal
(
$where
);
$m_store
=
new
AStore
();
$m_pay_adjustment
=
new
OPayLogAdjustment
();
$m_report
=
new
OReportModel
();
$m_agent_house
=
new
GHousesToAgents
();
$m_house
=
new
GHouses
();
$m_refund
=
new
ORefundModel
();
foreach
(
$list
as
$k
=>
$v
)
{
$list
[
$k
][
'source_id'
]
=
$list
[
$k
][
'is_adjustment'
]
=
''
;
...
...
@@ -3234,31 +3230,53 @@ class Finance extends Basic
}
$list
[
$k
][
'current_agent_name'
]
=
$list
[
$k
][
'store_name'
]
=
""
;
if
(
$v
[
'type'
]
==
92
)
{
$is_exclusive_type
=
$m_house
->
getHouseValue
(
'is_exclusive_type'
,
[
'id'
=>
$v
[
'house_id'
]]);
//案场费 对应业务员:盘方
$current_where
[
'a.is_del'
]
=
0
;
if
(
$is_exclusive_type
)
{
$current_where
[
'a.type'
]
=
3
;
}
else
{
$current_where
[
'a.type'
]
=
2
;
if
((
$v
[
'type'
]
==
92
||
$v
[
'type'
]
==
91
)
&&
$v
[
'bargain_id'
]
>
0
)
{
$bargain_where
[]
=
[
'EXP'
,
'a.id ='
.
$v
[
'bargain_id'
]
.
' or father_id='
.
$v
[
'bargain_id'
]];
$bargain_where
[
'a.status'
]
=
[
'in'
,
'10,11,13'
];
$bargain_where
[
'a.role'
]
=
[
'in'
,
'3,4,5'
];
$bargain_data
=
$this
->
m_bargain
->
agentBargainAll
(
'a.role,a.scale,b.name'
,
$bargain_where
);
$role_arr
=
[
1
=>
'盘方'
,
2
=>
'客方'
,
3
=>
'反签'
,
4
=>
'独家'
,
5
=>
'合作方'
,
6
=>
'APP盘下载方'
,
7
=>
'APP客下载方'
];
$name
=
''
;
foreach
(
$bargain_data
as
$k2
=>
$v2
)
{
$name
.=
$v2
[
'name'
]
.
'('
.
$role_arr
[
$v2
[
'role'
]]
.
$v2
[
'scale'
]
.
'%),'
;
}
$current_agent_name
=
$m_agent_house
->
getHousesAgents
(
$v
[
'house_id'
],
'b.name,b.store_id'
,
$current_where
);
$list
[
$k
][
'current_agent_name'
]
=
empty
(
$current_agent_name
[
0
][
'name'
])
?
''
:
$current_agent_name
[
0
][
'name'
];
$store_name
=
$m_store
->
getStoreKeyById
(
'store_name'
,
[
'id'
=>
$current_agent_name
[
0
][
'store_id'
]]);
$list
[
$k
][
'store_name'
]
=
empty
(
$store_name
)
?
''
:
$store_name
;
$list
[
$k
][
'current_agent_name'
]
=
rtrim
(
$name
,
','
);
}
if
(
$v
[
'type'
]
==
10
||
$v
[
'type'
]
==
30
||
$v
[
'type'
]
==
91
)
{
//意向金/保管金 10/30 对应业务员:约带看的人 即 反签方
//中介费 对应业务员:约带看的人 即 反签方
if
(
$v
[
'type'
]
==
10
||
$v
[
'type'
]
==
30
)
{
if
(
isset
(
$house_data
[
0
][
'f_id'
]))
{
$current_agent_name
=
$m_report
->
selectReportById
(
'report_agent_name,report_store_id'
,
[
'id'
=>
$v
[
'f_id'
]]);
if
(
!
empty
(
$current_agent_name
[
0
][
'report_store_id'
]))
{
$store_name
=
$m_store
->
getStoreKeyById
(
'store_name'
,
[
'id'
=>
$current_agent_name
[
0
][
'report_store_id'
]]);
$list
[
$k
][
'store_name'
]
=
empty
(
$store_name
)
?
''
:
$store_name
;
$list
[
$k
][
'current_agent_name'
]
=
empty
(
$current_agent_name
[
0
][
'report_agent_name'
])
?
""
:
$current_agent_name
[
0
][
'report_agent_name'
];
}
$list
[
$k
][
'current_agent_name'
]
=
empty
(
$current_agent_name
[
0
][
'report_agent_name'
])
?
''
:
$current_agent_name
[
0
][
'report_agent_name'
];
}
// if ($v['type'] == 92) {
// $is_exclusive_type = $m_house->getHouseValue('is_exclusive_type', ['id'=>$v['house_id']]);
// //案场费 对应业务员:盘方
// $current_where['a.is_del'] = 0;
// if ($is_exclusive_type) {
// $current_where['a.type'] = 3;
// } else {
// $current_where['a.type'] = 2;
// }
// $current_agent_name = $m_agent_house->getHousesAgents($v['house_id'], 'b.name,b.store_id', $current_where);
// $list[$k]['current_agent_name'] = empty($current_agent_name[0]['name']) ? '':$current_agent_name[0]['name'];
// $store_name = $m_store->getStoreKeyById('store_name', ['id'=>$current_agent_name[0]['store_id']]);
// $list[$k]['store_name'] = empty($store_name)? '' : $store_name;
// }
//
// if ($v['type'] == 10 || $v['type'] == 30 || $v['type'] == 91) {
// //意向金/保管金 10/30 对应业务员:约带看的人 即 反签方
// //中介费 对应业务员:约带看的人 即 反签方
// $current_agent_name = $m_report->selectReportById('report_agent_name,report_store_id', ['id'=>$v['f_id']]);
// if (!empty($current_agent_name[0]['report_store_id'])) {
// $store_name = $m_store->getStoreKeyById('store_name', ['id'=>$current_agent_name[0]['report_store_id']]);
// $list[$k]['store_name'] = empty($store_name)? '' : $store_name;
// }
// $list[$k]['current_agent_name'] = empty($current_agent_name[0]['report_agent_name']) ? '' : $current_agent_name[0]['report_agent_name'];
// }
if
(
!
empty
(
$v
[
'income_time'
]))
{
$income_time
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
$v
[
'income_time'
]));
...
...
@@ -3323,10 +3341,10 @@ class Finance extends Basic
$export
->
exportTable
(
'收款记录'
,
$excel_data
,
12
,
'收款记录'
,
$title
);
}
}
catch
(
\Exception
$e
)
{
$msg
=
'内部错误:'
.
$e
->
getMessage
();
return
$this
->
error
(
$msg
);
}
//
} catch (\Exception $e) {
//
$msg = '内部错误:' . $e->getMessage();
//
return $this->error($msg);
//
}
}
...
...
@@ -3603,7 +3621,6 @@ class Finance extends Basic
}
$m_report
=
new
OReportModel
();
$pay_data
[
'current_agent_name'
]
=
''
;
$pay_data
[
'current_agent_name'
]
=
$pay_data
[
'store_name'
]
=
""
;
if
((
$pay_data
[
'type'
]
==
92
||
$pay_data
[
'type'
]
==
91
)
&&
$pay_data
[
'bargain_id'
]
>
0
)
{
$where
[]
=
[
'EXP'
,
'a.id ='
.
$pay_data
[
'bargain_id'
]
.
' or father_id='
.
$pay_data
[
'bargain_id'
]];
...
...
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