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
512a56fb
Commit
512a56fb
authored
May 28, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
6f8af585
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
36 deletions
+81
-36
Finance.php
application/index/controller/Finance.php
+19
-17
OTaxes.php
application/model/OTaxes.php
+62
-19
No files found.
application/index/controller/Finance.php
View file @
512a56fb
...
@@ -632,23 +632,7 @@ class Finance extends Basic
...
@@ -632,23 +632,7 @@ class Finance extends Basic
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
}
}
/**
* 编辑开票税费查询某一条记录
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getTaxesById
()
{
if
(
empty
(
$this
->
params
[
'taxes_id'
]))
{
return
$this
->
response
(
101
,
'查询开票税费参数错误!'
);
}
$m_fee
=
new
OTaxes
();
$field
=
'id,bargain_id,fee,total_fee,father_id,operation_id,operation_date,agent_id,agent_name,role,scale,is_del'
;
$data
=
$m_fee
->
getTaxesId
(
$this
->
params
[
'taxes_id'
],
$field
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
}
/**
/**
* 新增开票
* 新增开票
...
@@ -730,6 +714,24 @@ class Finance extends Basic
...
@@ -730,6 +714,24 @@ class Finance extends Basic
return
$this
->
response
(
200
,
""
,
$data
);
return
$this
->
response
(
200
,
""
,
$data
);
}
}
/**
* 编辑开票税费查询某一条记录
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getTaxesById
()
{
if
(
empty
(
$this
->
params
[
'taxes_id'
]))
{
return
$this
->
response
(
101
,
'查询开票税费参数错误!'
);
}
$m_fee
=
new
OTaxes
();
$field
=
'id,bargain_id,fee,total_fee,father_id,operation_id,operation_date,agent_id,agent_name,role,scale,is_del'
;
$data
=
$m_fee
->
getTaxesId
(
$this
->
params
[
'taxes_id'
],
$field
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
}
/**
/**
* 税费承担明细表
* 税费承担明细表
*
*
...
...
application/model/OTaxes.php
View file @
512a56fb
...
@@ -22,7 +22,8 @@ class OTaxes extends BaseModel
...
@@ -22,7 +22,8 @@ class OTaxes extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
getBargainTaxes
(
int
$bargain_id
,
$field
=
'id as fee_id,fee,operation_date'
)
{
public
function
getBargainTaxes
(
int
$bargain_id
,
$field
=
'id as fee_id,fee,operation_date'
)
{
return
$this
->
field
(
$field
)
return
$this
->
field
(
$field
)
->
where
(
'bargain_id'
,
$bargain_id
)
->
where
(
'bargain_id'
,
$bargain_id
)
->
where
(
'is_del'
,
0
)
->
where
(
'is_del'
,
0
)
...
@@ -36,7 +37,8 @@ class OTaxes extends BaseModel
...
@@ -36,7 +37,8 @@ class OTaxes extends BaseModel
* @param int $type
* @param int $type
* @return int|string
* @return int|string
*/
*/
public
function
getBargainFeeTotal
(
int
$bargain_id
,
int
$type
=
0
)
{
public
function
getBargainFeeTotal
(
int
$bargain_id
,
int
$type
=
0
)
{
return
$this
->
where
(
'bargain_id'
,
$bargain_id
)
return
$this
->
where
(
'bargain_id'
,
$bargain_id
)
->
where
(
'type'
,
$type
)
->
where
(
'type'
,
$type
)
->
count
();
->
count
();
...
@@ -55,7 +57,8 @@ class OTaxes extends BaseModel
...
@@ -55,7 +57,8 @@ class OTaxes extends BaseModel
* @return array|false
* @return array|false
* @throws \Exception
* @throws \Exception
*/
*/
public
function
addTaxes
(
$data
,
$bargain_id
,
int
$agent_id
,
$father_id
=
0
,
$total_fee
=
0
,
$operation_date
=
''
)
{
public
function
addTaxes
(
$data
,
$bargain_id
,
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
)
{
...
@@ -85,7 +88,8 @@ class OTaxes extends BaseModel
...
@@ -85,7 +88,8 @@ class OTaxes extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
getBargainFeeDetail
(
int
$bargain_id
,
string
$field
)
{
public
function
getBargainFeeDetail
(
int
$bargain_id
,
string
$field
)
{
$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'
)
...
@@ -116,11 +120,47 @@ class OTaxes extends BaseModel
...
@@ -116,11 +120,47 @@ class OTaxes extends BaseModel
* @param string $field
* @param string $field
* @return false|\PDOStatement|string|\think\Collection
* @return false|\PDOStatement|string|\think\Collection
*/
*/
public
function
getTaxesId
(
int
$taxesId
,
string
$field
)
{
public
function
getTaxesId
(
int
$taxesId
,
string
$field
)
return
$this
->
field
(
$field
)
{
->
where
(
'id'
,
$taxesId
)
$params
[
"id|father_id"
]
=
$taxesId
;
->
where
(
'is_del'
,
0
)
$params
[
"is_del"
]
=
0
;
$data
=
$this
->
field
(
$field
)
->
where
(
$params
)
->
select
();
->
select
();
$m_agent
=
new
AAgents
();
$result
=
[];
foreach
(
$data
as
$k
=>
$v
)
{
if
(
isset
(
$v
[
'role'
]))
{
$agent_name
=
$m_agent
->
getAgentInfo
(
'id,name,phone'
,
$v
[
'agent_id'
]);
$result
[
$k
][
'id'
]
=
$agent_name
[
'id'
];
$result
[
$k
][
'name'
]
=
$agent_name
[
'name'
];
$result
[
$k
][
'phone'
]
=
$agent_name
[
'phone'
];
$result
[
$k
][
'role'
]
=
$v
[
'role'
];
$result
[
$k
][
'scale'
]
=
$v
[
'scale'
];
$result
[
$k
][
'fee'
]
=
$v
[
'fee'
];
switch
(
$v
[
'role'
])
{
case
1
:
$result
[
$k
][
'role_name'
]
=
'盘方'
;
break
;
case
2
:
$result
[
$k
][
'role_name'
]
=
'客方'
;
break
;
case
3
:
$result
[
$k
][
'role_name'
]
=
'反签'
;
break
;
case
4
:
$result
[
$k
][
'role_name'
]
=
'独家'
;
break
;
case
5
:
$result
[
$k
][
'role_name'
]
=
'合作方'
;
break
;
}
}
}
return
$result
;
}
}
/**
/**
...
@@ -136,11 +176,12 @@ class OTaxes extends BaseModel
...
@@ -136,11 +176,12 @@ class OTaxes extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
getTaxesList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'a.id desc'
,
$field
=
''
,
$params
=
''
)
{
public
function
getTaxesList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'a.id desc'
,
$field
=
''
,
$params
=
''
)
{
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'o_bargain b'
,
'a.bargain_id = b.id'
,
'left'
)
->
join
(
'o_bargain b'
,
'a.bargain_id = b.id'
,
'left'
)
->
join
(
'o_order c'
,
'b.order_id = c.id'
,
'left'
)
->
join
(
'o_order c'
,
'b.order_id = c.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
join
(
'a_agents e'
,
'b.agent_id = e.id'
,
'left'
)
->
join
(
'a_agents e'
,
'b.agent_id = e.id'
,
'left'
)
->
where
(
$params
)
->
where
(
$params
)
->
order
(
$order_
)
->
order
(
$order_
)
...
@@ -151,8 +192,8 @@ class OTaxes extends BaseModel
...
@@ -151,8 +192,8 @@ class OTaxes extends BaseModel
$m_agent
=
new
AAgents
();
$m_agent
=
new
AAgents
();
foreach
(
$data
as
$k
=>
$v
)
{
foreach
(
$data
as
$k
=>
$v
)
{
if
(
isset
(
$v
[
'agent_id'
]))
{
if
(
isset
(
$v
[
'agent_id'
]))
{
$district_store
=
$m_agent
->
getStoreDistrict
(
'store_name,district_name'
,
[
'a.id'
=>
$v
[
'agent_id'
]
]);
$district_store
=
$m_agent
->
getStoreDistrict
(
'store_name,district_name'
,
[
'a.id'
=>
$v
[
'agent_id'
]
]);
$data
[
$k
][
'district_store'
]
=
$district_store
[
'district_name'
]
.
'-'
.
$district_store
[
'store_name'
];
$data
[
$k
][
'district_store'
]
=
$district_store
[
'district_name'
]
.
'-'
.
$district_store
[
'store_name'
];
}
}
}
}
return
$data
;
return
$data
;
...
@@ -164,11 +205,12 @@ class OTaxes extends BaseModel
...
@@ -164,11 +205,12 @@ class OTaxes extends BaseModel
* @param $params
* @param $params
* @return int|string
* @return int|string
*/
*/
public
function
getTaxesListTotal
(
$params
)
{
public
function
getTaxesListTotal
(
$params
)
{
return
$this
->
alias
(
'a'
)
return
$this
->
alias
(
'a'
)
->
join
(
'o_bargain b'
,
'a.bargain_id = b.id'
,
'left'
)
->
join
(
'o_bargain b'
,
'a.bargain_id = b.id'
,
'left'
)
->
join
(
'o_order c'
,
'b.order_id = c.id'
,
'left'
)
->
join
(
'o_order c'
,
'b.order_id = c.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
join
(
'a_agents e'
,
'b.agent_id = e.id'
,
'left'
)
->
join
(
'a_agents e'
,
'b.agent_id = e.id'
,
'left'
)
->
where
(
$params
)
->
where
(
$params
)
->
count
();
->
count
();
...
@@ -181,7 +223,8 @@ class OTaxes extends BaseModel
...
@@ -181,7 +223,8 @@ class OTaxes extends BaseModel
* @param array $where
* @param array $where
* @return array
* @return array
*/
*/
public
function
getFeeListColumn
(
string
$field
,
array
$where
)
{
public
function
getFeeListColumn
(
string
$field
,
array
$where
)
{
return
$this
->
where
(
$where
)
return
$this
->
where
(
$where
)
->
column
(
$field
);
->
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