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
8d5e2f32
Commit
8d5e2f32
authored
Nov 02, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
成交报告导出
parent
6128d413
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
15 deletions
+59
-15
Finance.php
application/index/controller/Finance.php
+59
-15
No files found.
application/index/controller/Finance.php
View file @
8d5e2f32
...
...
@@ -125,23 +125,26 @@ class Finance extends Basic
$where
[
'a.id'
]
=
$this
->
params
[
'bargain_id'
];
$is_show
=
1
;
}
$excel_title
=
'成交报告'
;
switch
(
$check_status
)
{
case
2
:
//成交报告列表-第二级审核
$where
[
'a.audit_level'
]
=
1
;
$where
[
'a.status'
]
=
11
;
$excel_title
.=
'-第二级审核'
;
break
;
case
3
:
//成交报告列表-第三级审核
$where
[
'a.audit_level'
]
=
2
;
$where
[
'a.status'
]
=
11
;
$excel_title
.=
'-第三级审核'
;
break
;
case
4
:
//成交报告列表-已结单
$where
[
'a.account_statement'
]
=
1
;
$where
[
'a.status'
]
=
13
;
$where
[
'a.audit_level'
]
=
3
;
$excel_title
.=
'-已结单'
;
break
;
case
5
:
//成交报告列表-待撤销
...
...
@@ -176,12 +179,14 @@ class Finance extends Basic
//成交报告列表-全部
$where
[
'a.status'
]
=
[
'IN'
,
'10,11,13'
];
$is_show
=
0
;
$excel_title
.=
'-全部'
;
break
;
default
:
//成交报告列表-第一级审核
$order
=
'a.id DESC'
;
$where
[
'a.status'
]
=
10
;
$where
[
'a.audit_level'
]
=
0
;
$excel_title
.=
'-第三级审核'
;
}
if
(
!
empty
(
$this
->
params
[
'status'
]))
{
...
...
@@ -248,25 +253,64 @@ class Finance extends Basic
$is_show
=
1
;
}
$list_data
=
$this
->
m_bargain
->
getBargainList
(
$pageNo
,
$pageSize
,
$order
,
$fields
,
$where
);
if
(
empty
(
$this
->
params
[
'excel'
]))
{
$list_data
=
$this
->
m_bargain
->
getBargainList
(
$pageNo
,
$pageSize
,
$order
,
$fields
,
$where
);
$m_real
=
new
ORealIncome
();
foreach
(
$list_data
as
$k
=>
$v
)
{
$list_data
[
$k
][
'income_money'
]
=
$m_real
->
sumField
(
'money'
,[
'bargain_id'
=>
$v
[
'id'
],
'is_del'
=>
0
]);
}
$m_real
=
new
ORealIncome
();
foreach
(
$list_data
as
$k
=>
$v
)
{
$list_data
[
$k
][
'income_money'
]
=
$m_real
->
sumField
(
'money'
,[
'bargain_id'
=>
$v
[
'id'
],
'is_del'
=>
0
]);
}
$data
[
'data'
][
'list'
]
=
$list_data
;
$data
[
'data'
][
'total'
]
=
$this
->
m_bargain
->
getBargainTotal
(
$where
);
$data
[
'data'
][
'step'
]
=
$check_status
;
$data
[
'data'
][
'list'
]
=
$list_data
;
$data
[
'data'
][
'total'
]
=
$this
->
m_bargain
->
getBargainTotal
(
$where
);
$data
[
'data'
][
'step'
]
=
$check_status
;
if
(
$is_show
)
{
$data
[
'data'
][
'total_commission'
]
=
$this
->
m_bargain
->
getBargainListSum
(
'commission'
,
$where
);
$data
[
'data'
][
'total_income_money'
]
=
$m_real
->
getIncomeListSum
(
'money'
,
$where
);
if
(
$is_show
)
{
$data
[
'data'
][
'total_commission'
]
=
$this
->
m_bargain
->
getBargainListSum
(
'commission'
,
$where
);
$data
[
'data'
][
'total_income_money'
]
=
$m_real
->
getIncomeListSum
(
'money'
,
$where
);
}
else
{
$data
[
'data'
][
'total_commission'
]
=
0
;
$data
[
'data'
][
'total_income_money'
]
=
0
;
}
}
else
{
$data
[
'data'
][
'total_commission'
]
=
0
;
$data
[
'data'
][
'total_income_money'
]
=
0
;
}
$list_data
=
$this
->
m_bargain
->
getBargainList
(
1
,
10
,
$order
,
$fields
,
$where
);
if
(
!
empty
(
$list_data
))
{
$excel_data
=
[];
$m_real
=
new
ORealIncome
();
foreach
(
$list_data
as
$k
=>
$v
)
{
switch
(
$v
[
'trade_type'
])
{
case
10
:
$string
=
'出租 '
;
break
;
case
20
:
$string
=
'增佣 '
;
break
;
case
30
:
$string
=
'代理 '
;
break
;
case
40
:
$string
=
'好处费 '
;
break
;
default
:
$string
=
'其他'
;
}
$excel_data
[
$k
][
'id'
]
=
$v
[
'id'
];
$excel_data
[
$k
][
'create_time'
]
=
$v
[
'create_time'
];
$excel_data
[
$k
][
'is_open'
]
=
$v
[
'is_open'
]
?
'是'
:
'否'
;
$excel_data
[
$k
][
'internal_address'
]
=
$v
[
'internal_address'
];
$excel_data
[
$k
][
'house_number'
]
=
$v
[
'house_number'
];
$excel_data
[
$k
][
'price'
]
=
$v
[
'price'
];
$excel_data
[
$k
][
'submit_agent_name'
]
=
$v
[
'submit_agent_name'
];
$excel_data
[
$k
][
'trade_type'
]
=
$string
;
$excel_data
[
$k
][
'commission'
]
=
$v
[
'commission'
];
$excel_data
[
$k
][
'income_money'
]
=
$m_real
->
sumField
(
'money'
,[
'bargain_id'
=>
$v
[
'id'
],
'is_del'
=>
0
]);
$excel_data
[
$k
][
'subtract'
]
=
$v
[
'commission'
]
-
$excel_data
[
$k
][
'income_money'
];
}
$export
=
new
ExportExcelUntil
();
$title
=
[
'ID'
,
'提交时间'
,
'是否开业'
,
'商铺地址'
,
'商铺号'
,
'成交价'
,
'提交人'
,
'成交类型'
,
'应收佣金(元)'
,
'已收佣金(元)'
,
'未收佣金(元)'
];
$export
->
exportTable
(
$excel_title
,
$excel_data
,
11
,
$excel_title
,
$title
);
}
}
}
catch
(
\Exception
$e
)
{
return
$this
->
response
(
101
,
'内部错误,获取列表失败!请联系运营。'
.
$e
->
getMessage
());
}
...
...
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