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
b08a2361
Commit
b08a2361
authored
May 23, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开票税费列表
parent
d63768b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
Finance.php
application/index/controller/Finance.php
+2
-2
OFee.php
application/model/OFee.php
+12
-13
No files found.
application/index/controller/Finance.php
View file @
b08a2361
...
@@ -606,7 +606,7 @@ class Finance extends Basic
...
@@ -606,7 +606,7 @@ class Finance extends Basic
return
$this
->
response
(
101
,
'查询开票税费参数错误!'
);
return
$this
->
response
(
101
,
'查询开票税费参数错误!'
);
}
}
$m_fee
=
new
OFee
();
$m_fee
=
new
OFee
();
$field
=
'a.id,a.
fee,a.operation_date,b.scale,c.name,c.phone,b.rol
e'
;
$field
=
'a.id,a.
total_fee,a.operation_dat
e'
;
$data
=
$m_fee
->
getBargainFeeDetail
(
$this
->
params
[
'bargain_id'
],
1
,
$field
);
$data
=
$m_fee
->
getBargainFeeDetail
(
$this
->
params
[
'bargain_id'
],
1
,
$field
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
}
}
...
@@ -641,7 +641,7 @@ class Finance extends Basic
...
@@ -641,7 +641,7 @@ class Finance extends Basic
$insert_data
[
'operation_id'
]
=
$this
->
userId
;
$insert_data
[
'operation_id'
]
=
$this
->
userId
;
$insert_data
[
'operation_date'
]
=
$operation_date
;
$insert_data
[
'operation_date'
]
=
$operation_date
;
$insert_data
[
'type'
]
=
1
;
$insert_data
[
'type'
]
=
1
;
$m_fee
->
editData
(
$insert_data
,
$this
->
params
[
'
total_
id'
]);
$m_fee
->
editData
(
$insert_data
,
$this
->
params
[
'id'
]);
$father_id
=
$m_fee
->
id
;
$father_id
=
$m_fee
->
id
;
$data
=
$m_fee
->
addFee
(
$tax
,
$bargain_id
,
1
,
$this
->
userId
,
$father_id
,
$this
->
params
[
'total_fee'
],
$operation_date
);
$data
=
$m_fee
->
addFee
(
$tax
,
$bargain_id
,
1
,
$this
->
userId
,
$father_id
,
$this
->
params
[
'total_fee'
],
$operation_date
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
...
...
application/model/OFee.php
View file @
b08a2361
...
@@ -58,7 +58,7 @@ class OFee extends BaseModel
...
@@ -58,7 +58,7 @@ class OFee extends BaseModel
public
function
addFee
(
$data
,
$bargain_id
,
$type
=
0
,
int
$agent_id
,
$father_id
=
0
,
$total_fee
=
0
,
$operation_date
=
''
)
{
public
function
addFee
(
$data
,
$bargain_id
,
$type
=
0
,
int
$agent_id
,
$father_id
=
0
,
$total_fee
=
0
,
$operation_date
=
''
)
{
$insert_data
=
[];
$insert_data
=
[];
foreach
(
$data
as
$k
=>
$v
)
{
foreach
(
$data
as
$k
=>
$v
)
{
$insert_data
[
$k
][
'id'
]
=
$v
[
'id'
];
$insert_data
[
$k
][
'id'
]
=
$v
[
'
fee_
id'
];
$insert_data
[
$k
][
'bargain_id'
]
=
$bargain_id
;
$insert_data
[
$k
][
'bargain_id'
]
=
$bargain_id
;
$insert_data
[
$k
][
'fee'
]
=
$v
[
'fee'
];
$insert_data
[
$k
][
'fee'
]
=
$v
[
'fee'
];
$insert_data
[
$k
][
'operation_id'
]
=
$agent_id
;
$insert_data
[
$k
][
'operation_id'
]
=
$agent_id
;
...
@@ -92,25 +92,24 @@ class OFee extends BaseModel
...
@@ -92,25 +92,24 @@ class OFee extends BaseModel
$data
=
$this
->
field
(
$field
)
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
alias
(
'a'
)
->
join
(
'o_bargain b'
,
'a.bargain_id = b.id'
,
'left'
)
->
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
(
'bargain_id'
,
$bargain_id
)
->
where
(
'type'
,
$type
)
->
where
(
'type'
,
$type
)
->
where
(
'a.father_id'
,
0
)
->
select
();
->
select
();
$
grouped
=
[];
$
result
=
[];
foreach
(
$data
as
$
value
)
{
foreach
(
$data
as
$
k
=>
$v
)
{
$
grouped
[
$value
[
'operation_date'
]][]
=
$value
;
$
result
[
$k
]
=
$v
;
}
if
(
isset
(
$v
[
'id'
]))
{
$result
[
$k
][
'fee_list'
]
=
$this
->
field
(
'a.id as feed_id,a.fee,c.phone,c.name,b.role,b.scale'
)
foreach
(
$grouped
as
$k
=>
$v
)
{
->
alias
(
'a'
)
$total
=
0
;
->
join
(
'o_bargain b'
,
'a.bargain_id = b.id'
,
'left'
)
foreach
(
$v
as
$kk
=>
$vv
)
{
->
join
(
'a_agents c'
,
'b.agent_id = c.id'
,
'left'
)
$total
+=
$vv
[
'fee'
]
;
->
where
(
'a.father_id'
,
$v
[
'id'
])
->
select
()
;
}
}
$grouped
[
$k
][
'total'
]
=
$total
;
}
}
return
$
grouped
;
return
$
result
;
}
}
/**
/**
...
...
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