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
2e046e26
Commit
2e046e26
authored
Jul 19, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
申请费用导出
parent
6856a4fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
8 deletions
+95
-8
Cost.php
application/index/controller/Cost.php
+95
-8
No files found.
application/index/controller/Cost.php
View file @
2e046e26
...
...
@@ -35,20 +35,44 @@ class Cost extends Basic
$fee_model
=
new
FApplyForFee
();
if
(
$this
->
params
[
'excel'
]
!=
1
)
{
$list
=
$fee_model
->
getJoinAgentList
(
$pageNo
,
$pageSize
,
'ID DESC'
,
$field
,
$where
);
$list
=
$fee_model
->
getJoinAgentList
(
$pageNo
,
$pageSize
,
'
a.
ID DESC'
,
$field
,
$where
);
$data
[
'list'
]
=
&
$list
;
$data
[
'total'
]
=
$fee_model
->
getJoinAgentListTotal
(
$where
);
return
$this
->
response
(
200
,
''
,
$data
);
}
else
{
$list
=
$fee_model
->
getJoinAgentList
(
1
,
100000
,
'ID DESC'
,
$field
,
$where
);
$list
=
$fee_model
->
getJoinAgentList
(
1
,
100000
,
'
a.
ID DESC'
,
$field
,
$where
);
$source
=
[
0
=>
'app申请'
,
1
=>
'excel导入'
];
$status
=
[
0
=>
'申请中'
,
1
=>
'总监通过'
,
2
=>
'一审通过'
,
3
=>
'二审通过'
,
4
=>
'三审通过'
,
];
foreach
(
$list
as
$k
=>
$v
)
{
$excel_data
[
$k
]
=
[
'id'
=>
$v
[
'id'
],
'count_time'
=>
$v
[
'count_time'
],
'create_time'
=>
$v
[
'create_time'
],
'agent_name'
=>
$v
[
'agent_name'
],
'total_fee'
=>
$v
[
'total_fee'
],
'type_name'
=>
$this
->
getFeeType
(
$v
[
'type'
]),
'fee_item_name'
=>
$this
->
getFeeItem
(
$v
[
'fee_item'
]),
'purpose'
=>
$v
[
'purpose'
],
'source_name'
=>
$source
[
$v
[
'source'
]],
'status'
=>
$status
[
$v
[
'status'
]]
];
}
$export
=
new
ExportExcelUntil
();
// $title = [ 'ID', '提交时间', '商铺地址', '商铺号', '成交价', '提交人', '成交类型', '应收佣金(元)','已收佣金(元)','未收佣金(元)' ];
// $export->exportTable($excel_title, $excel_data, 11, $excel_title, $title);
if
(
isset
(
$excel_data
))
{
$export
=
new
ExportExcelUntil
();
$title
=
[
'费用总ID'
,
'计入月份'
,
'提交时间'
,
'提交人'
,
'费用总金额'
,
'费用类型'
,
'费用项目'
,
'费用用途'
,
'来源'
,
'状态'
];
$export
->
exportTable
(
'费用报销审核'
,
$excel_data
,
11
,
'费用报销审核'
,
$title
);
}
}
}
...
...
@@ -60,8 +84,8 @@ class Cost extends Basic
*/
private
function
buildWhere
(
$param
)
{
if
(
isset
(
$param
[
'check
out
_status'
]))
{
switch
(
$
this
->
params
[
'check_status'
])
{
if
(
isset
(
$param
[
'check_status'
]))
{
switch
(
$
param
[
'check_status'
])
{
case
0
:
$where
[
'a.status'
]
=
0
;
break
;
case
1
:
...
...
@@ -217,4 +241,66 @@ class Cost extends Basic
}
return
$this
->
response
(
$code
,
$result
[
'msg'
]);
}
/**
* 获取费用项目
*
* @param $key
* @return string
*/
private
function
getFeeItem
(
$key
)
{
$item_array
=
[
100
=>
'房租租金'
,
101
=>
'水电费'
,
102
=>
'其他费用'
,
201
=>
'总部固定成本'
,
301
=>
'分部固定成本'
,
401
=>
'同联发展基金'
,
501
=>
'家庭基金报销'
,
502
=>
'社保报销'
,
503
=>
'总经理基薪'
,
504
=>
'区域秘书基薪'
,
505
=>
'招聘成本'
,
506
=>
'区域经理基本工资平摊'
,
507
=>
'宿舍成本'
,
508
=>
'宿舍亏损'
,
509
=>
'手续费'
,
510
=>
'员工工资成本'
,
511
=>
'网络报销'
,
512
=>
'离职员工网络'
,
513
=>
'门店独有成本其他费用'
];
if
(
array_key_exists
(
$key
,
$item_array
))
{
$result
=
$item_array
[
$key
];
}
else
{
$result
=
'未知'
;
}
return
$result
;
}
/**
* 获取费用报销类型
*
* @param $key
* @return string
*/
private
function
getFeeType
(
$key
)
{
$type_array
=
[
0
=>
'办公室成本'
,
1
=>
'总部成本'
,
2
=>
'分部成本'
,
3
=>
'门店独有成本'
,
];
if
(
array_key_exists
(
$key
,
$type_array
))
{
$result
=
$type_array
[
$key
];
}
else
{
$result
=
'未知'
;
}
return
$result
;
}
}
\ No newline at end of file
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