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
13305089
Commit
13305089
authored
Sep 03, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
费用报销导出增加字段
parent
1fb6959a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
6 deletions
+55
-6
Cost.php
application/index/controller/Cost.php
+45
-5
FOffice.php
application/model/FOffice.php
+10
-1
No files found.
application/index/controller/Cost.php
View file @
13305089
...
@@ -53,8 +53,10 @@ class Cost extends Basic
...
@@ -53,8 +53,10 @@ class Cost extends Basic
$data
[
'total'
]
=
$fee_model
->
getJoinAgentListTotal
(
$where
);
$data
[
'total'
]
=
$fee_model
->
getJoinAgentListTotal
(
$where
);
return
$this
->
response
(
200
,
''
,
$data
);
return
$this
->
response
(
200
,
''
,
$data
);
}
else
{
}
else
{
$field
.=
',a.card_name,a.card_no,a.store_id,a.office_id'
;
$list
=
$fee_model
->
getJoinAgentList
(
1
,
100000
,
'a.ID DESC'
,
$field
,
$where
);
$list
=
$fee_model
->
getJoinAgentList
(
1
,
100000
,
'a.ID DESC'
,
$field
,
$where
);
$cost_service
=
new
CostService
();
$cost_service
=
new
CostService
();
$redis
=
new
RedisCacheService
();
$source
=
[
$source
=
[
0
=>
'app申请'
,
0
=>
'app申请'
,
1
=>
'excel导入'
1
=>
'excel导入'
...
@@ -67,7 +69,31 @@ class Cost extends Basic
...
@@ -67,7 +69,31 @@ class Cost extends Basic
4
=>
'三审通过'
,
4
=>
'三审通过'
,
];
];
$redis
=
new
RedisCacheService
();
foreach
(
$list
as
$k
=>
$v
)
{
switch
(
$v
[
'type'
])
{
case
5
:
$store_id
[]
=
$v
[
'store_id'
];
break
;
default
:
$office_id
[]
=
$v
[
'office_id'
];
break
;
}
}
$store_data
=
$office_data
=
[];
if
(
isset
(
$store_id
))
{
$store_id
=
array_filter
(
$store_id
);
$store_id
=
array_unique
(
$store_id
);
$m_store
=
new
AStore
();
$store_data
=
$m_store
->
getColumn
(
'id,store_name'
,
[
'id'
=>
[
'in'
,
$store_id
]]);
}
if
(
isset
(
$office_id
))
{
$office_id
=
array_filter
(
$office_id
);
$office_id
=
array_unique
(
$office_id
);
$m_office
=
new
FOffice
();
$office_data
=
$m_office
->
getColumn
(
'id,office_name'
,
[
'id'
=>
[
'in'
,
$office_id
]]);
}
foreach
(
$list
as
$k
=>
$v
)
{
foreach
(
$list
as
$k
=>
$v
)
{
$type_name
=
$cost_service
->
getFeeType
(
$v
[
'type'
]);
$type_name
=
$cost_service
->
getFeeType
(
$v
[
'type'
]);
$fee_item_name
=
$cost_service
->
getFeeItem
(
$v
[
'fee_item'
]);
$fee_item_name
=
$cost_service
->
getFeeItem
(
$v
[
'fee_item'
]);
...
@@ -76,6 +102,16 @@ class Cost extends Basic
...
@@ -76,6 +102,16 @@ class Cost extends Basic
$type_name
=
$city_name
.
'-'
.
$type_name
;
$type_name
=
$city_name
.
'-'
.
$type_name
;
}
}
$store_name
=
$office_name
=
''
;
switch
(
$v
[
'type'
])
{
case
5
:
$store_name
=
array_key_exists
(
$v
[
'store_id'
],
$store_data
)
?
$store_data
[
$v
[
'store_id'
]]
:
''
;
break
;
default
:
$office_name
=
array_key_exists
(
$v
[
'office_id'
],
$office_data
)
?
$office_data
[
$v
[
'office_id'
]]
:
''
;
break
;
}
$excel_data
[
$k
]
=
[
$excel_data
[
$k
]
=
[
'id'
=>
$v
[
'id'
],
'id'
=>
$v
[
'id'
],
'count_time'
=>
$v
[
'count_time'
],
'count_time'
=>
$v
[
'count_time'
],
...
@@ -86,14 +122,18 @@ class Cost extends Basic
...
@@ -86,14 +122,18 @@ class Cost extends Basic
'fee_item_name'
=>
$fee_item_name
,
'fee_item_name'
=>
$fee_item_name
,
'purpose'
=>
$v
[
'purpose'
],
'purpose'
=>
$v
[
'purpose'
],
'source_name'
=>
$source
[
$v
[
'source'
]],
'source_name'
=>
$source
[
$v
[
'source'
]],
'status'
=>
$status
[
$v
[
'status'
]]
'status'
=>
$status
[
$v
[
'status'
]],
'card_name'
=>
$v
[
'card_name'
],
'card_no'
=>
$v
[
'card_no'
],
'store_name'
=>
$store_name
,
'office_name'
=>
$office_name
];
];
}
}
if
(
isset
(
$excel_data
))
{
if
(
isset
(
$excel_data
))
{
$export
=
new
ExportExcelUntil
();
$export
=
new
ExportExcelUntil
();
$title
=
[
'费用总ID'
,
'计入月份'
,
'提交时间'
,
'提交人'
,
'费用总金额'
,
'费用类型'
,
'费用项目'
,
'费用用途'
,
'来源'
,
'状态'
];
$title
=
[
'费用总ID'
,
'计入月份'
,
'提交时间'
,
'提交人'
,
'费用总金额'
,
'费用类型'
,
'费用项目'
,
'费用用途'
,
$export
->
exportTable
(
'费用报销审核'
,
$excel_data
,
11
,
'费用报销审核'
,
$title
);
'来源'
,
'状态'
,
'收款户名'
,
'收款卡账号'
,
'费用承担门店'
,
'费用承担办公室'
];
$export
->
exportTable
(
'费用报销审核'
,
$excel_data
,
13
,
'费用报销审核'
,
$title
);
}
}
}
}
}
}
...
...
application/model/FOffice.php
View file @
13305089
...
@@ -97,5 +97,14 @@ class FOffice extends BaseModel
...
@@ -97,5 +97,14 @@ class FOffice extends BaseModel
return
$this
->
db_
->
update
(
$params
);
return
$this
->
db_
->
update
(
$params
);
}
}
/**
* @param $field
* @param $where
* @return array
*/
public
function
getColumn
(
$field
,
$where
)
{
return
$this
->
db_
->
where
(
$where
)
->
column
(
$field
);
}
}
}
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