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
a7a702c5
Commit
a7a702c5
authored
May 21, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取成交报告详情
parent
488939e2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
5 deletions
+58
-5
Finance.php
application/index/controller/Finance.php
+3
-2
OBargainModel.php
application/model/OBargainModel.php
+22
-3
OFee.php
application/model/OFee.php
+33
-0
No files found.
application/index/controller/Finance.php
View file @
a7a702c5
...
...
@@ -58,7 +58,7 @@ 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'
;
$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
;
...
...
@@ -179,7 +179,8 @@ class Finance extends Basic
$data
[
'msg'
]
=
'Id is null.'
;
}
else
{
$bargain
=
new
OBargainModel
();
$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'
;
$fields
=
'a.id,a.create_time,b.user_phone,b.user_name,d.internal_title,d.internal_address,a.is_open,'
;
$fields
.=
'a.trade_type,a.house_number,a.commission,a.content,d.shop_type'
;
$where
[
'a.id'
]
=
$this
->
params
[
'id'
];
$data
[
'data'
]
=
$bargain
->
getBargainInfo
(
$fields
,
$where
);
}
...
...
application/model/OBargainModel.php
View file @
a7a702c5
...
...
@@ -276,8 +276,8 @@ class OBargainModel extends Model
* @param int $id
* @param array $data
* @param int $source 审核来源 1成交报告申请结单 2退款 3申请撤销成交报告
* @param int $status
成交报告状态 10已提交 11审核成功 20待撤销 21已撤销 30删除
* @return
array
* @param int $status 成交报告状态 10已提交 11审核成功 20待撤销 21已撤销 30删除
* @return
bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
...
...
@@ -355,18 +355,28 @@ class OBargainModel extends Model
* @throws \think\exception\DbException
*/
public
function
getBargainInfo
(
$field
,
$params
)
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'o_report b'
,
'a.report_id = b.id'
,
'left'
)
->
join
(
'o_order c'
,
'a.order_id = c.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
where
(
$params
)
->
find
();
if
(
isset
(
$data
[
'id'
]))
{
$m_fee
=
new
OFee
();
$data
[
'practical_fee'
]
=
$m_fee
->
getBargainFee
(
$data
[
'id'
]);
//获取实收佣金
}
return
$data
;
}
/**
* @param $params
* @param $type
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAddBargainNumGroupTime
(
$params
,
$type
){
$field
=
""
;
...
...
@@ -398,6 +408,7 @@ class OBargainModel extends Model
public
function
getAddBargainNum
(
$params
,
$type
){
$where_
=
[];
$field
=
""
;
if
(
$type
==
1
){
$field
=
"sum(scale_fee) as num"
;
}
elseif
(
$type
==
2
){
...
...
@@ -459,6 +470,14 @@ class OBargainModel extends Model
->
count
();
}
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getBargainDetail
(
$field
,
$params
){
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
...
...
application/model/OFee.php
0 → 100644
View file @
a7a702c5
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/5/21
* Time: 10:20
*/
namespace
app\model
;
class
OFee
extends
BaseModel
{
/**
* 根据成交报告查询
*
* @param int $bargain_id
* @param int $type
* @param string $field
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getBargainFee
(
int
$bargain_id
,
$type
=
0
,
string
$field
=
'id as fee_id,tax_fee,create_time'
)
{
return
$this
->
field
(
$field
)
->
where
(
'bargain_id'
,
$bargain_id
)
->
where
(
'type'
,
$type
)
->
select
();
}
}
\ 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