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
0877db97
Commit
0877db97
authored
May 22, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
税费承担明细表
parent
9463d539
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
14 deletions
+70
-14
Finance.php
application/index/controller/Finance.php
+16
-14
OFee.php
application/model/OFee.php
+54
-0
No files found.
application/index/controller/Finance.php
View file @
0877db97
...
...
@@ -663,40 +663,42 @@ class Finance extends Basic
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$fields
=
'a.id,a.create_time,b.user_phone,b.user_name,d.internal_title,d.internal_address,a.commission,a.practical_fee,a.scale_fee,a.order_no,content,house_number'
;
$where
[
'a.father_id'
]
=
0
;
$where
[
'c.is_del'
]
=
0
;
$where
[
'a.status'
]
=
10
;
$fields
=
'a.id,a.create_time,e.name,e.phone,a.fee,b.house_number,d.internal_address,b.agent_id'
;
$order
=
'e.id desc'
;
$where
[
'c.is_del'
]
=
0
;
$where
[
'b.status'
]
=
[
'in'
,
10
,
11
];
//10已提交 11审核成功
if
(
!
empty
(
$this
->
params
[
'create_time'
])
&&
empty
(
$this
->
params
[
'end_time'
]))
{
$where
[
'
e
.create_time'
]
=
[
'> time'
,
$this
->
params
[
'create_time'
]
.
' 00:00:00'
];
$where
[
'
a
.create_time'
]
=
[
'> time'
,
$this
->
params
[
'create_time'
]
.
' 00:00:00'
];
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
empty
(
$this
->
params
[
'create_time'
]))
{
$where
[
'
e
.create_time'
]
=
[
'< time'
,
$this
->
params
[
'create_time'
]
.
' 23:59:59'
];
$where
[
'
a
.create_time'
]
=
[
'< time'
,
$this
->
params
[
'create_time'
]
.
' 23:59:59'
];
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
!
empty
(
$this
->
params
[
'create_time'
]))
{
$where
[
'
e
.create_time'
]
=
[
'between time'
,
[
$this
->
params
[
'create_time'
]
.
' 00:00:00'
,
$this
->
params
[
'create_time'
]
.
' 23:59:59'
]];
$where
[
'
a
.create_time'
]
=
[
'between time'
,
[
$this
->
params
[
'create_time'
]
.
' 00:00:00'
,
$this
->
params
[
'create_time'
]
.
' 23:59:59'
]];
}
if
(
!
empty
(
$this
->
params
[
'internal_address'
]))
{
$where
[
'd.internal_address'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'internal_address'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'user_phone'
]))
{
$where
[
'b.user_phone'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'user_phone'
]
.
'%'
];
if
(
!
empty
(
$this
->
params
[
'phone'
]))
{
$where
[
'e.phone'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'phone'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'name'
]))
{
$where
[
'e.name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'name'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'house_number'
]))
{
$where
[
'
a
.house_number'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'house_number'
]
.
'%'
];
$where
[
'
b
.house_number'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'house_number'
]
.
'%'
];
}
$
bargain
=
new
OBargainModel
();
$data
[
'data'
][
'list'
]
=
$
bargain
->
getBargain
(
$pageNo
,
$pageSize
,
$order
,
$fields
,
$where
);
$data
[
'data'
][
'total'
]
=
$
bargain
->
getBargain
Total
(
$where
);
$
m_fee
=
new
OFee
();
$data
[
'data'
][
'list'
]
=
$
m_fee
->
getFeeList
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$fields
,
$where
);
$data
[
'data'
][
'total'
]
=
$
m_fee
->
getFeeList
Total
(
$where
);
return
$this
->
response
(
$data
[
'code'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
...
...
application/model/OFee.php
View file @
0877db97
...
...
@@ -86,4 +86,57 @@ class OFee extends BaseModel
->
where
(
'type'
,
$type
)
->
select
();
}
/**
* 税费承担明细表
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getFeeList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'a.id desc'
,
$field
=
''
,
$params
=
''
)
{
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'o_bargain b'
,
'a.bargain_id = b.id'
,
'left'
)
->
join
(
'o_order c'
,
'b.order_id = c.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
join
(
'a_agents e'
,
'b.agent_id = e.id'
,
'left'
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
$m_agent
=
new
AAgents
();
foreach
(
$data
as
$k
=>
$v
)
{
if
(
isset
(
$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'
];
}
}
return
$data
;
}
/**
* 税费承担明细表总数
*
* @param $params
* @return int|string
*/
public
function
getFeeListTotal
(
$params
)
{
return
$this
->
alias
(
'a'
)
->
join
(
'o_bargain b'
,
'a.bargain_id = b.id'
,
'left'
)
->
join
(
'o_order c'
,
'b.order_id = c.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
join
(
'a_agents e'
,
'b.agent_id = e.id'
,
'left'
)
->
where
(
$params
)
->
count
();
}
}
\ 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