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
5ad1fb4b
Commit
5ad1fb4b
authored
Oct 26, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
财务代码同步
parent
757df5d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
78 deletions
+77
-78
Finance.php
application/index/controller/Finance.php
+77
-78
No files found.
application/index/controller/Finance.php
View file @
5ad1fb4b
...
...
@@ -23,9 +23,17 @@ use app\model\OPartialCommission;
use
app\model\OPayLogModel
;
use
app\model\ORefundModel
;
use
app\task\controller\ResultsSummaryNewTask
;
use
think\Request
;
class
Finance
extends
Basic
{
private
$m_bargain
;
public
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
m_bargain
=
new
OBargainModel
();
}
/**
* 成交报告
*
...
...
@@ -66,44 +74,55 @@ class Finance extends Basic
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$check_status
=
$this
->
params
[
'check_status'
];
$fields
=
'a.id,a.create_time,a.trade_type,b.user_phone,b.user_name,d.internal_title,d.internal_address,
a.commission,a.practical_fee,a.scale_fee,a.order_no,a.order_id,content,house_number,a.is_open,a.agent_id,
a.submit_agent_name,a.price,a.audit_level'
;
$fields
=
'a.id,a.create_time,a.trade_type,b.user_phone,b.user_name,d.internal_title,
d.internal_address,a.commission,a.practical_fee,a.scale_fee,a.order_no,
a.order_id,content,house_number,a.is_open,a.agent_id,a.submit_agent_name,
a.price,a.audit_level,'
;
$fields
.=
'e.id as partial_commission_id'
;
$where
[
'a.father_id'
]
=
0
;
$where
[
'a.status'
]
=
11
;
$order
=
'a.id desc'
;
$where
[
'a.status'
]
=
11
;
$order
=
'a.id desc'
;
$is_show
=
0
;
if
(
!
empty
(
$this
->
params
[
'create_time'
])
&&
empty
(
$this
->
params
[
'end_time'
]))
{
$where
[
'a.create_time'
]
=
[
'> time'
,
$this
->
params
[
'create_time'
]
.
' 00:00:00'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
empty
(
$this
->
params
[
'create_time'
]))
{
$where
[
'a.create_time'
]
=
[
'< time'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
!
empty
(
$this
->
params
[
'create_time'
]))
{
$where
[
'a.create_time'
]
=
[
'between time'
,
[
$this
->
params
[
'create_time'
]
.
' 00:00:00'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
]
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'internal_address'
]))
{
$where
[
'd.internal_address'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'internal_address'
]
.
'%'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'user_phone'
]))
{
$where
[
'b.user_phone'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'user_phone'
]
.
'%'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'house_number'
]))
{
$where
[
'a.house_number'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'house_number'
]
.
'%'
];
$is_show
=
1
;
}
//商铺类型(0商场,1街铺)
if
(
isset
(
$this
->
params
[
'shop_type'
])
&&
$this
->
params
[
'shop_type'
]
!=
-
1
)
{
$where
[
'd.shop_type'
]
=
$this
->
params
[
'shop_type'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'bargain_id'
]))
{
$where
[
'a.id'
]
=
$this
->
params
[
'bargain_id'
];
$is_show
=
1
;
}
switch
(
$check_status
)
{
...
...
@@ -127,29 +146,35 @@ class Finance extends Basic
//成交报告列表-待撤销
$where
[
'a.status'
]
=
20
;
$where
[
'a.audit_level'
]
=
0
;
$is_show
=
0
;
break
;
case
6
:
//成交报告列表-已撤销
$where
[
'a.status'
]
=
21
;
$is_show
=
0
;
break
;
case
7
:
//成交报告列表-待撤销-第一级审核
$where
[
'a.status'
]
=
20
;
$where
[
'a.audit_level'
]
=
1
;
$is_show
=
0
;
break
;
case
8
:
//成交报告列表-待撤销-第二级审核
$where
[
'a.status'
]
=
20
;
$where
[
'a.audit_level'
]
=
2
;
$is_show
=
0
;
break
;
case
9
:
//成交报告列表-待撤销-第三级审核
$where
[
'a.status'
]
=
20
;
$where
[
'a.audit_level'
]
=
3
;
$is_show
=
0
;
break
;
case
10
:
//成交报告列表-
待撤销-第三级审核
//成交报告列表-
全部
$where
[
'a.status'
]
=
[
'IN'
,
'10,11,13'
];
$is_show
=
0
;
break
;
default
:
//成交报告列表-第一级审核
...
...
@@ -163,8 +188,6 @@ class Finance extends Basic
}
try
{
$bargain
=
new
OBargainModel
();
if
(
!
empty
(
$this
->
params
[
'district_id'
]))
{
$agent_where
[
'a.district_id'
]
=
$this
->
params
[
'district_id'
];
}
...
...
@@ -220,9 +243,25 @@ class Finance extends Basic
}
}
$data
[
'data'
][
'list'
]
=
$bargain
->
getBargainList
(
$pageNo
,
$pageSize
,
$order
,
$fields
,
$where
);
$data
[
'data'
][
'total'
]
=
$bargain
->
getBargainTotal
(
$where
);
$list_data
=
$this
->
m_bargain
->
getBargainList
(
$pageNo
,
$pageSize
,
$order
,
$fields
,
$where
);
$m_real
=
new
ORealIncome
();
foreach
(
$list_data
as
$k
=>
$v
)
{
$list_data
[
$k
][
'income_money'
]
=
$m_real
->
sumField
(
'money'
,[
'bargain_id'
=>
$v
[
'id'
],
'is_del'
=>
0
]);
}
$data
[
'data'
][
'list'
]
=
$list_data
;
$data
[
'data'
][
'total'
]
=
$this
->
m_bargain
->
getBargainTotal
(
$where
);
$data
[
'data'
][
'step'
]
=
$check_status
;
if
(
$is_show
)
{
$data
[
'data'
][
'total_commission'
]
=
$this
->
m_bargain
->
getBargainListSum
(
'commission'
,
$where
);
$data
[
'data'
][
'total_income_money'
]
=
$m_real
->
getIncomeListSum
(
'money'
,
$where
);
}
else
{
$data
[
'data'
][
'total_commission'
]
=
0
;
$data
[
'data'
][
'total_income_money'
]
=
0
;
}
}
catch
(
\Exception
$e
)
{
return
$this
->
response
(
101
,
'内部错误,获取列表失败!请联系运营。'
.
$e
->
getMessage
());
}
...
...
@@ -241,8 +280,6 @@ class Finance extends Basic
$data
[
'msg'
]
=
""
;
$data
[
'data'
]
=
[];
$bargain
=
new
OBargainModel
();
if
(
empty
(
$this
->
params
[
'id'
])
||
empty
(
$this
->
params
[
'source'
])
||
empty
(
$this
->
params
[
'status'
]))
{
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'Id is null'
;
...
...
@@ -254,7 +291,7 @@ class Finance extends Basic
$params
[
'remark'
]
=
$this
->
params
[
'remark'
];
try
{
$status
=
$bargain
->
addCheckBargain
(
$this
->
params
[
'id'
],
$params
,
$this
->
params
[
'source'
],
$this
->
params
[
'status'
]);
$status
=
$
this
->
m_
bargain
->
addCheckBargain
(
$this
->
params
[
'id'
],
$params
,
$this
->
params
[
'source'
],
$this
->
params
[
'status'
]);
}
catch
(
\Exception
$e
)
{
return
$this
->
response
(
101
,
'内部错误,审核失败!请联系运营。'
);
}
...
...
@@ -285,12 +322,11 @@ class Finance extends Basic
$data
[
'code'
]
=
101
;
$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.is_open,a.order_id,'
;
$fields
.=
'a.trade_type,a.house_number,a.commission,a.content,d.shop_type,a.industry_type,a.price,a.estimated_receipt_date,'
;
$fields
.=
'b.user_id,d.id as house_id'
;
$where
[
'a.id'
]
=
$this
->
params
[
'id'
];
$data
[
'data'
]
=
$bargain
->
getBargainInfo
(
$fields
,
$where
);
$data
[
'data'
]
=
$
this
->
m_
bargain
->
getBargainInfo
(
$fields
,
$where
);
}
return
$this
->
response
(
$data
[
'code'
],
$data
[
'msg'
],
$data
[
'data'
]);
...
...
@@ -361,10 +397,10 @@ class Finance extends Basic
$update_data
[
'estimated_receipt_date'
]
=
$this
->
params
[
'estimated_receipt_date'
];
//预计收款时间
$m_bargain
=
new
OBargainModel
();
$m_real
=
new
ORealIncome
();
$data
[
'data'
]
=
$m_bargain
->
updateBargainById
(
$this
->
params
[
'id'
],
$update_data
);
$data
[
'data'
]
=
$
this
->
m_bargain
->
updateBargainById
(
$this
->
params
[
'id'
],
$update_data
);
if
(
$data
[
'data'
]
==
1
)
{
//新增实收佣金 array 5 todo feel_id 大于0 的表示新增 否则修改
...
...
@@ -432,14 +468,12 @@ class Finance extends Basic
$data
[
'msg'
]
=
""
;
$data
[
'data'
]
=
[];
if
(
empty
(
$this
->
params
[
'id'
])
||
empty
(
$this
->
params
[
'agent_id'
]))
{
if
(
empty
(
$this
->
params
[
'id'
])
||
empty
(
$this
->
params
[
'agent_id'
])
||
empty
(
$this
->
params
[
'role'
])
)
{
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'提交信息错误!'
;
}
else
{
$bargain
=
new
OBargainModel
();
try
{
$data
[
'data'
]
=
$bargain
->
addBargainCommission
(
$this
->
params
[
'id'
],
$this
->
userId
,
$this
->
params
[
'agent_id'
],
$data
[
'data'
]
=
$
this
->
m_
bargain
->
addBargainCommission
(
$this
->
params
[
'id'
],
$this
->
userId
,
$this
->
params
[
'agent_id'
],
$this
->
params
[
'role'
],
$this
->
params
[
'scale_fee'
],
$this
->
params
[
'scale'
],
1
);
$this
->
updatePerformance
((
int
)
$this
->
params
[
'bargain_id'
],
(
int
)
$this
->
params
[
'agent_id'
]);
...
...
@@ -474,11 +508,11 @@ class Finance extends Basic
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'Id is null.'
;
}
else
{
$m_comm
=
new
OBargainModel
();
$fields
=
'a.id,a.role,a.agent_id,a.scale,a.scale_fee,a.father_id'
;
$fields
.=
',e.id as partial_commission_id'
;
$where
[
0
]
=
[
'EXP'
,
"a.id =
{
$this
->
params
[
'id'
]
}
or a.father_id =
{
$this
->
params
[
'id'
]
}
"
];
$where
[
'a.status'
]
=
[
'<>'
,
30
];
$data
[
'data'
]
=
$
m_comm
->
getBargainPartial
(
1
,
100
,
'a.id desc'
,
$fields
,
$where
,
$this
->
params
[
'id'
]);
$data
[
'data'
]
=
$
this
->
m_bargain
->
getBargainPartial
(
1
,
100
,
'a.id desc'
,
$fields
,
$where
,
$this
->
params
[
'id'
]);
}
return
$this
->
response
(
$data
[
'code'
],
$data
[
'msg'
],
$data
[
'data'
]);
...
...
@@ -574,20 +608,19 @@ class Finance extends Basic
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$bargain
=
new
OBargainModel
();
$is
=
$bargain
->
ifBargainNumByOrderId
([
'id'
=>
$this
->
params
[
'id'
]
]);
$is
=
$this
->
m_bargain
->
ifBargainNumByOrderId
([
'id'
=>
$this
->
params
[
'id'
]
]);
if
(
$is
<
1
)
{
return
$this
->
response
(
"101"
,
"没有成交报告信息"
);
}
$bargain
->
updateBargainById
(
$this
->
params
[
'id'
],
[
'status'
=>
12
]);
$
this
->
m_
bargain
->
updateBargainById
(
$this
->
params
[
'id'
],
[
'status'
=>
12
]);
$params
[
'audit_id'
]
=
$this
->
userId
;
$params
[
'audit_name'
]
=
$this
->
userName
;
$params
[
'audit_id'
]
=
$this
->
userId
;
$params
[
'audit_level'
]
=
$this
->
params
[
'check_status'
];
$params
[
'remark'
]
=
$this
->
params
[
'remark'
];
$status
=
$bargain
->
addCheckBargain
(
$this
->
params
[
'id'
],
$params
,
2
,
2
);
$status
=
$
this
->
m_
bargain
->
addCheckBargain
(
$this
->
params
[
'id'
],
$params
,
2
,
2
);
if
(
$status
)
{
$data
[
'code'
]
=
200
;
...
...
@@ -778,38 +811,15 @@ class Finance extends Basic
$where
[
'a.confirm_status'
]
=
1
;
$where
[
'a.is_del'
]
=
0
;
if
(
!
empty
(
$this
->
params
[
'create_time'
])
&&
empty
(
$this
->
params
[
'end_time'
]))
{
$
income_where
[
'
income_time'
]
=
[
'>= time'
,
$this
->
params
[
'create_time'
]
.
' 00:00:00'
];
$
where
[
'f.
income_time'
]
=
[
'>= time'
,
$this
->
params
[
'create_time'
]
.
' 00:00:00'
];
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
empty
(
$this
->
params
[
'create_time'
]))
{
$
income_where
[
'
income_time'
]
=
[
'<= time'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
];
$
where
[
'f.
income_time'
]
=
[
'<= time'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
];
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
!
empty
(
$this
->
params
[
'create_time'
]))
{
$income_where
[
'income_time'
]
=
[
'between time'
,
[
$this
->
params
[
'create_time'
]
.
' 00:00:00'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
]
];
}
if
(
!
empty
(
$income_where
))
{
$m_real
=
new
ORealIncome
();
$bargain_arr
=
$m_real
->
getRealIncomeBargain
(
'bargain_id'
,
$income_where
);
if
(
$bargain_arr
[
'status'
]
==
'successful'
)
{
if
(
empty
(
$bargain_arr
[
'data'
]))
{
return
$this
->
response
(
200
,
''
);
}
foreach
(
$bargain_arr
[
'data'
]
as
$v
)
{
$bargain_id
[]
=
$v
[
'bargain_id'
];
}
if
(
!
empty
(
$bargain_id
))
{
$bargain_id_string
=
implode
(
','
,
$bargain_id
);
$where
[]
=
[
'EXP'
,
'b.id in ('
.
$bargain_id_string
.
') or b.father_id in ('
.
$bargain_id_string
.
')'
];
}
}
else
{
return
$this
->
response
(
101
,
'内部错误:'
.
$bargain_arr
[
'msg'
]);
}
$where
[
'f.income_time'
]
=
[
'between time'
,
[
$this
->
params
[
'create_time'
]
.
' 00:00:00'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
]
];
}
if
(
!
empty
(
$this
->
params
[
'internal_address'
]))
{
...
...
@@ -865,8 +875,7 @@ class Finance extends Basic
return
$this
->
response
(
101
,
'请求参数错误'
);
}
$m_bargain
=
new
OBargainModel
();
$bargain_data
=
$m_bargain
->
getCheckBargain
(
'a.id,a.agent_id,a.role,a.create_time,d.store_id,d.district_id'
,
$this
->
params
[
'bargain_id'
]);
$bargain_data
=
$this
->
m_bargain
->
getCheckBargain
(
'a.id,a.agent_id,a.role,a.create_time,d.store_id,d.district_id'
,
$this
->
params
[
'bargain_id'
]);
//排除成交报告其它状态
if
(
empty
(
$bargain_data
[
'id'
]))
{
...
...
@@ -981,7 +990,7 @@ class Finance extends Basic
$update_data
[
'scale_fee'
]
=
$v
[
'scale_fee'
];
$update_data
[
'scale'
]
=
$v
[
'scale'
];
$update_data
[
'agent_id'
]
=
$v
[
'agent_id'
];
$m_bargain
->
updateBargainById
(
$v
[
'bargain_id'
],
$update_data
);
$
this
->
m_bargain
->
updateBargainById
(
$v
[
'bargain_id'
],
$update_data
);
$this
->
updatePerformanceData
(
$v
[
'agent_id'
],
$v
[
'create_time'
],
$v
[
'store_id'
],
$v
[
'district_id'
]);
}
}
...
...
@@ -1041,8 +1050,7 @@ class Finance extends Basic
return
$this
->
response
(
101
,
'分佣方角色为空'
);
}
$m_bargain
=
new
OBargainModel
();
$bargain_data
=
$m_bargain
->
getCheckBargain
(
'a.id'
,
$this
->
params
[
'bargain_id'
]);
$bargain_data
=
$this
->
m_bargain
->
getCheckBargain
(
'a.id'
,
$this
->
params
[
'bargain_id'
]);
//排除成交报告其它状态
if
(
empty
(
$bargain_data
[
'id'
]))
{
...
...
@@ -1099,8 +1107,7 @@ class Finance extends Basic
if
(
empty
(
$this
->
params
[
'bargain_id'
]))
{
return
$this
->
response
(
101
,
'请求参数错误!'
);
}
$bargain
=
new
OBargainModel
();
$data
=
$bargain
->
getAgentTypeByBargainId
(
$this
->
params
[
'bargain_id'
]);
$data
=
$this
->
m_bargain
->
getAgentTypeByBargainId
(
$this
->
params
[
'bargain_id'
]);
return
$this
->
response
(
200
,
""
,
$data
);
}
...
...
@@ -1561,12 +1568,11 @@ class Finance extends Basic
$data
[
'is_del'
]
=
1
;
//去除之前的审核记录
$data
=
$m_financial
->
editData
(
$data
,
$this
->
params
[
'bargain_id'
],
'bargain_id'
);
$m_bargain
=
new
OBargainModel
();
$update_data
[
'status'
]
=
10
;
$update_data
[
'audit_level'
]
=
0
;
$where
[]
=
[
'EXP'
,
'id='
.
$this
->
params
[
'bargain_id'
]
.
' or father_id='
.
$this
->
params
[
'bargain_id'
]
];
$where
[
'status'
]
=
[
'<>'
,
30
];
$m_bargain
->
updateBargainByWhere
(
$update_data
,
$where
);
$
this
->
m_bargain
->
updateBargainByWhere
(
$update_data
,
$where
);
$msg
=
''
;
if
(
$data
>
0
)
{
$code
=
200
;
...
...
@@ -1592,7 +1598,6 @@ class Finance extends Basic
return
$this
->
response
(
101
,
'参数错误'
);
}
$m_bargain
=
new
OBargainModel
();
$m_partial_commission
=
new
OPartialCommission
();
$confirm_status
=
$m_partial_commission
->
checkConfirmStatus
(
$this
->
params
[
'bargain_id'
]);
...
...
@@ -1604,7 +1609,7 @@ class Finance extends Basic
$insert_data
[
'audit_id'
]
=
$this
->
userId
;
$insert_data
[
'audit_name'
]
=
$this
->
userName
;
$insert_data
[
'audit_level'
]
=
3
;
$data
=
$m_bargain
->
addCheckBargain
(
$this
->
params
[
'bargain_id'
],
$insert_data
,
1
,
11
);
$data
=
$
this
->
m_bargain
->
addCheckBargain
(
$this
->
params
[
'bargain_id'
],
$insert_data
,
1
,
11
);
$code
=
200
;
$msg
=
""
;
...
...
@@ -1695,8 +1700,7 @@ class Finance extends Basic
*/
public
function
editRecordLog
(
int
$bargain_id
,
string
$step_content
=
''
,
int
$type
=
1
,
string
$house_number
=
''
,
int
$is_open
=
0
)
{
$m_bargain
=
new
OBargainModel
();
$house_number_table
=
$m_bargain
->
getCheckBargain
(
'a.house_number,c.internal_address'
,
(
int
)
$bargain_id
,
'10,11,12,13,20,21,30'
);
$house_number_table
=
$this
->
m_bargain
->
getCheckBargain
(
'a.house_number,c.internal_address'
,
(
int
)
$bargain_id
,
'10,11,12,13,20,21,30'
);
$step_content
.=
"[
{
$house_number_table
[
'internal_address'
]
}
]"
;
if
(
empty
(
$house_number
))
{
...
...
@@ -1741,9 +1745,8 @@ class Finance extends Basic
return
$this
->
response
(
101
,
'参数错误'
);
$partial_id
=
$this
->
params
[
'partial_id'
];
$m_partial
=
new
OBargainModel
();
$data
[
'status'
]
=
30
;
$num
=
$
m_partial
->
updateBargainById
(
$partial_id
,
$data
);
$num
=
$
this
->
m_bargain
->
updateBargainById
(
$partial_id
,
$data
);
if
(
$num
>
0
)
{
$this
->
updatePerformance
(
$this
->
params
[
'partial_id'
]);
...
...
@@ -1794,11 +1797,9 @@ class Finance extends Basic
return
$this
->
response
(
101
,
'成交报告id为空'
);
}
$m_bargain
=
new
OBargainModel
();
if
(
$this
->
request
->
isGet
())
{
$field
=
'a.id,a.scale,a.agent_id,a.role,a.scale_fee,b.scale as new_scale,b.should_commission'
;
$data
=
$m_bargain
->
getBargainPartialDetail
(
$field
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]
]);
$data
=
$
this
->
m_bargain
->
getBargainPartialDetail
(
$field
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]
]);
return
$this
->
response
(
200
,
''
,
$data
);
}
...
...
@@ -1811,7 +1812,7 @@ class Finance extends Basic
}
//检查成交报告是否存在
$data_arr
=
$m_bargain
->
getBargainPartialDetail
(
'a.id,a.agent_id,a.create_time'
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]
]);
$data_arr
=
$
this
->
m_bargain
->
getBargainPartialDetail
(
'a.id,a.agent_id,a.create_time'
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]
]);
if
(
empty
(
$data_arr
[
'id'
]))
{
return
$this
->
response
(
101
,
'没有成交报告信息'
);
...
...
@@ -1822,7 +1823,7 @@ class Finance extends Basic
$update
[
'role'
]
=
$this
->
params
[
'role'
];
$update
[
'scale_fee'
]
=
$this
->
params
[
'scale_fee'
];
$data
=
$m_bargain
->
updateBargainById
(
$this
->
params
[
'bargain_id'
],
$update
);
//更改分佣方
$data
=
$
this
->
m_bargain
->
updateBargainById
(
$this
->
params
[
'bargain_id'
],
$update
);
//更改分佣方
$comm
=
new
OPartialCommission
();
$partial_data
[
'scale'
]
=
$this
->
params
[
'scale'
];
...
...
@@ -1832,7 +1833,7 @@ class Finance extends Basic
$this
->
updatePerformance
(
0
,
$data_arr
[
'agent_id'
]);
/*记录日志 start*/
$bargain_data
=
$m_bargain
->
selectBargainByOrderNo
(
'agent_id,father_id'
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]
]);
$bargain_data
=
$
this
->
m_bargain
->
selectBargainByOrderNo
(
'agent_id,father_id'
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]
]);
$father_id
=
$this
->
params
[
'bargain_id'
];
if
(
$bargain_data
[
0
][
'father_id'
]
!=
0
)
{
$father_id
=
$bargain_data
[
0
][
'father_id'
];
...
...
@@ -1874,9 +1875,8 @@ class Finance extends Basic
$code
=
200
;
$this
->
editRecordLog
(
$this
->
params
[
'bargain_id'
],
'[撤销成交报告]'
,
3
);
//日志记录
$this
->
updatePerformance
(
$this
->
params
[
'bargain_id'
]);
$bargain
=
new
OBargainModel
();
$bargain_data
=
$bargain
->
getBargainDetail
(
'order_id,order_no,agent_id'
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]
]);
$bargain_data
=
$
this
->
m_
bargain
->
getBargainDetail
(
'order_id,order_no,agent_id'
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]
]);
$financial_data
[
'bargain_id'
]
=
$this
->
params
[
'bargain_id'
];
$financial_data
[
'audit_name'
]
=
$this
->
userName
;
$financial_data
[
'audit_id'
]
=
$this
->
userId
;
...
...
@@ -1948,8 +1948,7 @@ class Finance extends Basic
$code
=
200
;
$msg
=
''
;
$m_real_income
=
new
ORealIncome
();
$m_bargain
=
new
OBargainModel
();
$father_id
=
$m_bargain
->
getBargainDetail
(
'father_id'
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]]);
$father_id
=
$this
->
m_bargain
->
getBargainDetail
(
'father_id'
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]]);
if
(
empty
(
$father_id
[
0
][
'father_id'
]))
{
$bargain_id
=
$this
->
params
[
'bargain_id'
];
...
...
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