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
48f0b235
Commit
48f0b235
authored
Jul 26, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取成交报告分佣方佣金和修改
parent
75580f11
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
0 deletions
+81
-0
Finance.php
application/index/controller/Finance.php
+33
-0
OBargainModel.php
application/model/OBargainModel.php
+47
-0
route.php
application/route.php
+1
-0
No files found.
application/index/controller/Finance.php
View file @
48f0b235
...
@@ -1384,4 +1384,37 @@ class Finance extends Basic
...
@@ -1384,4 +1384,37 @@ class Finance extends Basic
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
]);
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
]);
}
}
/**
* 成交报告分佣方详情
*
* @return type
*/
public
function
getBargainoCommission
()
{
if
(
empty
(
$this
->
params
[
'bargain_id'
]))
{
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'
;
$data
=
$m_bargain
->
getBargainPartialDetail
(
$field
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]]);
return
$this
->
response
(
200
,
''
,
$data
);
}
if
(
empty
(
$this
->
params
[
'agent_id'
]))
{
return
$this
->
response
(
101
,
'经纪人id为空'
);
}
if
(
empty
(
$this
->
params
[
'scale'
]))
{
return
$this
->
response
(
101
,
'分佣比例为空'
);
}
$update
[
'agent_id'
]
=
$this
->
params
[
'agent_id'
];
$update
[
'scale'
]
=
$this
->
params
[
'scale'
];
$data
=
$m_bargain
->
updateBargainById
(
$this
->
params
[
'bargain_id'
],
$update
);
return
$this
->
response
(
200
,
'修改成功'
,
$data
);
}
}
}
application/model/OBargainModel.php
View file @
48f0b235
...
@@ -278,6 +278,10 @@ class OBargainModel extends Model
...
@@ -278,6 +278,10 @@ class OBargainModel extends Model
$whereOr_
[
"a.father_id"
]
=
$params
[
"bargain_id"
];
$whereOr_
[
"a.father_id"
]
=
$params
[
"bargain_id"
];
}
}
if
(
$isset
(
$params
[
'id'
]))
{
$where_
[
'a.id'
]
=
$params
[
'id'
];
}
$result
=
$this
->
db_
$result
=
$this
->
db_
->
field
(
$filed
)
->
field
(
$filed
)
->
alias
(
"a"
)
->
alias
(
"a"
)
...
@@ -1105,4 +1109,46 @@ class OBargainModel extends Model
...
@@ -1105,4 +1109,46 @@ class OBargainModel extends Model
->
where
(
'a.id'
,
$id
)
->
where
(
'a.id'
,
$id
)
->
find
();
->
find
();
}
}
/**
* 成交报告分佣方详情
*
* @param type $param
* @return boolean
*/
public
function
getBargainPartialDetail
(
$filed
,
$param
)
{
$where_
=
$whereOr_
=
[];
if
(
isset
(
$param
[
"bargain_id"
]))
{
$where_
[
"a.id"
]
=
$params
[
"bargain_id"
];
$whereOr_
[
"a.father_id"
]
=
$params
[
"bargain_id"
];
}
if
(
isset
(
$param
[
'id'
]))
{
$where_
[
'a.id'
]
=
$param
[
'id'
];
}
try
{
$result
=
$this
->
db_
->
field
(
$filed
)
->
alias
(
"a"
)
->
join
(
"o_partial_commission b"
,
"a.id = b.bargain_id"
,
"left"
)
->
where
(
$where_
)
->
whereOr
(
$whereOr_
)
->
order
(
"a.id asc"
)
->
find
();
$m_agent
=
new
AAgents
();
$filed_agent
=
'a.id,a.name,a.phone,b.store_name,c.district_name'
;
$agent_info
=
$m_agent
->
getAgentsInfoByAgentId
(
$filed_agent
,
[
'agent_id'
=>
$result
[
'agent_id'
]]);
$result
[
'district_name'
]
=
$agent_info
[
0
][
'district_name'
];
$result
[
'store_name'
]
=
$agent_info
[
0
][
'store_name'
];
$result
[
'name'
]
=
$agent_info
[
0
][
'name'
];
$result
[
'phone'
]
=
$agent_info
[
0
][
'phone'
];
}
catch
(
\Exception
$ex
)
{
$result
=
false
;
}
return
$result
;
}
}
}
\ No newline at end of file
application/route.php
View file @
48f0b235
...
@@ -234,6 +234,7 @@ Route::group('index', [
...
@@ -234,6 +234,7 @@ Route::group('index', [
'checkOver'
=>
[
'index/Finance/checkOver'
,
[
'method'
=>
'POST'
]
],
//财务结单
'checkOver'
=>
[
'index/Finance/checkOver'
,
[
'method'
=>
'POST'
]
],
//财务结单
'delPartialCommission'
=>
[
'index/Finance/delPartialCommission'
,
[
'method'
=>
'POST'
]
],
//删除分佣方
'delPartialCommission'
=>
[
'index/Finance/delPartialCommission'
,
[
'method'
=>
'POST'
]
],
//删除分佣方
'delTaxes'
=>
[
'index/Finance/delTaxes'
,
[
'method'
=>
'POST'
]
],
//删除开票税费
'delTaxes'
=>
[
'index/Finance/delTaxes'
,
[
'method'
=>
'POST'
]
],
//删除开票税费
'getBargainoCommission'
=>
[
'index/Finance/getBargainoCommission'
,
[
'method'
=>
'GET|POST'
]
],
//获取成交报告分佣方佣金和修改
'addReceiptImg'
=>
[
'index/Collection/addReceiptImg'
,
[
'method'
=>
'post|get'
]
],
//收款图片信息保存
'addReceiptImg'
=>
[
'index/Collection/addReceiptImg'
,
[
'method'
=>
'post|get'
]
],
//收款图片信息保存
'deleteReceiptImg'
=>
[
'index/Collection/deleteReceiptImg'
,
[
'method'
=>
'post|get'
]
],
//删除收款图片
'deleteReceiptImg'
=>
[
'index/Collection/deleteReceiptImg'
,
[
'method'
=>
'post|get'
]
],
//删除收款图片
'receiptImgList'
=>
[
'index/Collection/receiptImgList'
,
[
'method'
=>
'post|get'
]
],
//收款列表-收款图片列表
'receiptImgList'
=>
[
'index/Collection/receiptImgList'
,
[
'method'
=>
'post|get'
]
],
//收款列表-收款图片列表
...
...
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