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
175ccefe
Commit
175ccefe
authored
May 24, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
把、
parent
7bfffcda
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
8 deletions
+73
-8
OrderLog.php
application/api_broker/controller/OrderLog.php
+2
-2
OrderLogService.php
application/api_broker/service/OrderLogService.php
+49
-6
OPartialCommission.php
application/model/OPartialCommission.php
+21
-0
ORealIncome.php
application/model/ORealIncome.php
+1
-0
No files found.
application/api_broker/controller/OrderLog.php
View file @
175ccefe
...
...
@@ -421,9 +421,9 @@ class OrderLog extends Basic
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*
$params = array(
$params
=
array
(
"bargain_id"
=>
169
,
);
*/
);
if
(
!
isset
(
$params
[
"bargain_id"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
...
...
application/api_broker/service/OrderLogService.php
View file @
175ccefe
...
...
@@ -9,13 +9,17 @@ use app\model\GHousesFollowUp;
use
app\model\GHousesToAgents
;
use
app\model\OBargainModel
;
use
app\model\OMarchInModel
;
use
app\model\OPartialCommission
;
use
app\model\OPayLogModel
;
use
app\model\OrderModel
;
use
app\model\ORealIncome
;
use
app\model\ORefundModel
;
use
app\model\OReportModel
;
use
app\model\OTaxes
;
use
app\model\Regions
;
use
app\model\UPhoneFollowPp
;
use
app\model\Users
;
use
think\helper\Arr
;
/**
...
...
@@ -802,12 +806,12 @@ class OrderLogService
/**
* 获取我得成交报告详情
* @param $params
* @return
false|\PDOStatement|string|\think\Collection
* @return
array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getBargainDetail
(
$params
)
public
function
getBargainDetail
(
$params
)
:
array
{
$bargainModel
=
new
OBargainModel
();
...
...
@@ -817,14 +821,53 @@ class OrderLogService
$result
=
[];
$bargainInfo
=
$bargainModel
->
selectBargainDetail
(
$bargain_info_filed
,
$params
);
$result
[
"bargainInfo"
]
=
$bargainInfo
;
if
(
count
(
$bargainInfo
)
<=
0
)
{
return
[];
}
//分佣提成
$cent_commission
=
[];
//o_real_income
$realIncomeModel
=
new
ORealIncome
();
$realIncomeArr
=
$realIncomeModel
->
getBargainTaxes
(
$params
[
"bargain_id"
]);
$bargainInfo
[
0
][
"realIncome"
]
=
$realIncomeArr
;
$result
[
"bargainInfo"
]
=
$bargainInfo
[
0
];
//分佣提成 o_partial_commission
$partialCommissionModel
=
new
OPartialCommission
();
$field
=
"a.agent_id,a.role,b.name,b.phone,a.scale,a.should_commission,a.create_time,a.real_fee,a.charity_fund,
a.cash,a.practical_fee"
;
$commissionParams
[
"bargain_id"
]
=
$params
[
"bargain_id"
];
$cent_commission_arr
=
$partialCommissionModel
->
getCommissionListByBargainId
(
$field
,
$commissionParams
);
//dump($cent_commission_arr);exit;
$cent_commission
=
array
();
foreach
(
$cent_commission_arr
as
$k
=>
$v
)
{
$cent_commission
[
$v
[
'agent_id'
]][]
=
$v
;
}
/* $z = 0;
foreach ($cent_commission_ as $item) {
$cent_commission[$z]["agent_id"] = $item[0]["agent_id"];
$cent_commission[$z]["role"] = $item[0]["role"];
$cent_commission[$z]["name"] = $item[0]["name"];
$cent_commission[$z]["phone"] = $item[0]["phone"];
$cent_commission[$z]["should_commission"] = $item[0]["should_commission"];
$key = 0;
foreach ($item as $i => $j) {
$cent_commission[$z]["info"][$key]["real_fee"] = $j["real_fee"];
$cent_commission[$z]["info"][$key]["create_time"] = $j["create_time"];
$cent_commission[$z]["info"][$key]["charity_fund"] = $j["charity_fund"];
$cent_commission[$z]["info"][$key]["cash"] = $j["cash"];
$cent_commission[$z]["info"][$key]["practical_fee"] = $j["practical_fee"];
$key++;
}
$z++;
}*/
$result
[
"cent_commission"
]
=
$cent_commission
;
//税费
$taxesModel
=
new
OTaxes
();
$taxesModel
->
getBargainTaxes
(
$params
[
"bargain_id"
]);
$taxes
=
[];
$result
[
"taxes"
]
=
$taxes
;
...
...
application/model/OPartialCommission.php
View file @
175ccefe
...
...
@@ -164,4 +164,24 @@ class OPartialCommission extends BaseModel
return
$this
->
update
(
$insert_data
);
}
}
/**
* 获取我的交易的分佣明细
*
* @param $field
* @param $params
* @return mixed
*/
public
function
getCommissionListByBargainId
(
$field
,
$params
){
$params
[
"a.is_del"
]
=
0
;
$result
=
$this
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"a_agents b"
,
"a.agent_id=b.id"
,
"left"
)
->
where
(
$params
)
->
order
(
"a.create_time desc"
)
->
select
();
echo
$this
->
getLastSql
();
return
$result
;
}
}
\ No newline at end of file
application/model/ORealIncome.php
View file @
175ccefe
...
...
@@ -44,6 +44,7 @@ class ORealIncome extends BaseModel
public
function
getBargainTaxes
(
int
$bargain_id
,
$field
=
'id as fee_id,money,income_time'
)
{
return
$this
->
field
(
$field
)
->
where
(
'bargain_id'
,
$bargain_id
)
->
where
(
'is_del'
,
0
)
->
select
();
}
...
...
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