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
f73c9071
Commit
f73c9071
authored
May 18, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分佣提成明细表
parent
8b52e7be
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
101 additions
and
3 deletions
+101
-3
Finance.php
application/index/controller/Finance.php
+9
-3
commission.html
application/index/view/finance/commission.html
+3
-0
AAgents.php
application/model/AAgents.php
+21
-0
OPartialCommission.php
application/model/OPartialCommission.php
+67
-0
route.php
application/route.php
+1
-0
No files found.
application/index/controller/Finance.php
View file @
f73c9071
...
...
@@ -495,6 +495,12 @@ class Finance extends Basic
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
}
/**
* @return \think\Response|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
partialCommissionList
()
{
if
(
!
$this
->
request
->
isAjax
())
{
return
view
(
'commission'
);
...
...
@@ -503,11 +509,11 @@ class Finance extends Basic
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$where
=
[];
$field
=
'a.
create_time,a.practical_fee,b.scale_fee,d.internal_address,b.agent_id
'
;
$field
=
'a.
id,a.create_time,a.practical_fee,b.scale_fee,d.internal_address,b.agent_id,b.house_number
'
;
$m_commission
=
new
OPartialCommission
();
$data
[
'data'
][
'list'
]
=
$m_commission
->
getCommissionBargainList
(
$pageNo
,
$pageSize
,
'id desc'
,
$field
,
$where
);
$data
[
'data'
][
'total'
]
=
$m_commission
->
selectRefundByOrderNoPage
Total
(
$where
);
$data
[
'data'
][
'list'
]
=
$m_commission
->
getCommissionBargainList
(
$pageNo
,
$pageSize
,
'
a.
id desc'
,
$field
,
$where
);
$data
[
'data'
][
'total'
]
=
$m_commission
->
getCommissionBargainList
Total
(
$where
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
}
}
application/index/view/finance/commission.html
0 → 100644
View file @
f73c9071
{layout name="global/frame_tpl" /}
分佣提成明细表
\ No newline at end of file
application/model/AAgents.php
View file @
f73c9071
...
...
@@ -805,4 +805,24 @@ class AAgents extends BaseModel
->
where
(
$params
)
->
find
();
}
/**
* 经纪人与部门和门店数据
*
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getStoreDistrict
(
$field
,
$where
)
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'a_store b'
,
'a.store_id = b.id'
,
'left'
)
->
join
(
'a_district c'
,
'a.district_id = c.id'
,
'left'
)
->
where
(
$where
)
->
find
();
}
}
\ No newline at end of file
application/model/OPartialCommission.php
0 → 100644
View file @
f73c9071
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/5/18
* Time: 10:26
*/
namespace
app\model
;
class
OPartialCommission
extends
BaseModel
{
/**
* 成交报告分佣表
*
* @param $pageNo
* @param $pageSize
* @param string $order_
* @param $fields
* @param $where
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getCommissionBargainList
(
$pageNo
,
$pageSize
,
$order_
=
'id desc'
,
$fields
,
$where
)
{
$data
=
$this
->
field
(
$fields
)
->
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'
)
->
where
(
$where
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
$result
=
[];
$m_agent
=
new
AAgents
();
$fields_str
=
'a.id,a.name,a.phone,b.store_name,c.district_name'
;
foreach
(
$data
as
$k
=>
$v
)
{
$result
[
$k
]
=
$v
;
if
(
$v
[
'agent_id'
])
{
$agent_data
=
$m_agent
->
getStoreDistrict
(
$fields_str
,
[
'a.id'
=>
$v
[
'agent_id'
]]);
$result
[
$k
][
'agent'
]
=
$agent_data
[
'name'
]
.
'-'
.
$agent_data
[
'phone'
];
$result
[
$k
][
'district_store'
]
=
$agent_data
[
'store_name'
]
.
'-'
.
$agent_data
[
'store_name'
];
}
}
return
$result
;
}
/**
* @param $where
* @return int|string
*/
public
function
getCommissionBargainListTotal
(
$where
)
{
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'
)
->
where
(
$where
)
->
count
();
}
}
\ No newline at end of file
application/route.php
View file @
f73c9071
...
...
@@ -214,6 +214,7 @@ Route::group('index', [
'payLogList'
=>
[
'index/Finance/payLogList'
,
[
'method'
=>
'get'
]
],
//收款记录
'phone_up_list'
=>
[
'index/remark/phone_up_list'
,
[
'method'
=>
'get|post'
]
],
//电话跟进列表
'selectReportAll'
=>
[
'index/Finance/selectReportAll'
,
[
'method'
=>
'get|post'
]
],
//时间轴
'partialCommissionList'
=>
[
'index/Finance/partialCommissionList'
,
[
'method'
=>
'get'
]
],
//分佣提成明细表
'test123'
=>
[
'index/WatchShop/test123'
,
[
'method'
=>
'get|post'
]
],
//时间轴
'agent_zhuan_aagent'
=>
[
'index/agent/agent_zhuan_aagent'
,
[
'method'
=>
'post|get'
]
],
//经纪人
'shop_a_store'
=>
[
'index/agent/shop_a_store'
,
[
'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