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
4a7565c1
Commit
4a7565c1
authored
May 23, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开票税费列表
parent
e7ae76db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
Finance.php
application/index/controller/Finance.php
+1
-1
OFee.php
application/model/OFee.php
+17
-2
No files found.
application/index/controller/Finance.php
View file @
4a7565c1
...
...
@@ -606,7 +606,7 @@ class Finance extends Basic
return
$this
->
response
(
101
,
'查询开票税费参数错误!'
);
}
$m_fee
=
new
OFee
();
$field
=
'a.id,a.fee,a.operation_date,b.scale,c.name,c.phone'
;
$field
=
'a.id,a.fee,a.operation_date,b.scale,c.name,c.phone
,b.role
'
;
$data
=
$m_fee
->
getBargainFeeDetail
(
$this
->
params
[
'bargain_id'
],
1
,
$field
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
}
...
...
application/model/OFee.php
View file @
4a7565c1
...
...
@@ -72,19 +72,34 @@ class OFee extends BaseModel
* @param int $bargain_id
* @param int $type
* @param string $field
* @return
false|\PDOStatement|string|\think\Collection
* @return
array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getBargainFeeDetail
(
int
$bargain_id
,
int
$type
=
0
,
string
$field
)
{
return
$this
->
field
(
$field
)
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'o_bargain b'
,
'a.bargain_id = b.id'
,
'left'
)
->
join
(
'a_agents c'
,
'b.agent_id = c.id'
,
'left'
)
->
where
(
'bargain_id'
,
$bargain_id
)
->
where
(
'type'
,
$type
)
->
select
();
$grouped
=
[];
foreach
(
$data
as
$value
)
{
$grouped
[
$value
[
'operation_date'
]][]
=
$value
;
}
foreach
(
$grouped
as
$k
=>
$v
)
{
$total
=
0
;
foreach
(
$v
as
$kk
=>
$vv
)
{
$total
+=
$vv
[
'fee'
];
}
$grouped
[
$k
][
'total'
]
=
$total
;
}
return
$grouped
;
}
/**
...
...
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