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
7add9f4f
Commit
7add9f4f
authored
Jul 03, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增分佣方 预计收款时间,分用方搜索
parent
7e063537
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
10 deletions
+35
-10
OrderLog.php
application/api_broker/controller/OrderLog.php
+8
-5
OrderLogService.php
application/api_broker/service/OrderLogService.php
+18
-5
Users.php
application/model/Users.php
+9
-0
No files found.
application/api_broker/controller/OrderLog.php
View file @
7add9f4f
...
@@ -219,7 +219,8 @@ class OrderLog extends Basic
...
@@ -219,7 +219,8 @@ class OrderLog extends Basic
if
(
!
isset
(
$params
[
"submit_agent_id"
])
||
!
isset
(
$params
[
"submit_agent_name"
])
||
!
isset
(
$params
[
"report_id"
])
||
if
(
!
isset
(
$params
[
"submit_agent_id"
])
||
!
isset
(
$params
[
"submit_agent_name"
])
||
!
isset
(
$params
[
"report_id"
])
||
!
isset
(
$params
[
"order_id"
])
||
!
isset
(
$params
[
"order_no"
])
||
!
isset
(
$params
[
"trade_type"
])
||
!
isset
(
$params
[
"order_id"
])
||
!
isset
(
$params
[
"order_no"
])
||
!
isset
(
$params
[
"trade_type"
])
||
//!isset($params["house_number"]) || !isset($params["is_open"]) || !isset($params["industry_type"]) ||
//!isset($params["estimated_receipt_date"]) ||
!
isset
(
$params
[
"house_number"
])
||
!
isset
(
$params
[
"is_open"
])
||
!
isset
(
$params
[
"industry_type"
])
||
!
isset
(
$params
[
"price"
])
||
!
isset
(
$params
[
"commission"
])
||
!
isset
(
$params
[
"commission_arr"
]))
{
!
isset
(
$params
[
"price"
])
||
!
isset
(
$params
[
"commission"
])
||
!
isset
(
$params
[
"commission_arr"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
}
...
@@ -234,8 +235,8 @@ class OrderLog extends Basic
...
@@ -234,8 +235,8 @@ class OrderLog extends Basic
"trade_type" => 10, //成交类型 10出租 20 增佣 30 代理 40 好处费
"trade_type" => 10, //成交类型 10出租 20 增佣 30 代理 40 好处费
"price" => 112131, //成交价格 存分
"price" => 112131, //成交价格 存分
"commission" => 111, //佣金 存分
"commission" => 111, //佣金 存分
"estimated_receipt_date" => '2018-07-15',
//`role` '分佣方 1盘方 2客方 3 反签 4独家 5合作方',
//`role` '分佣方 1盘方 2客方 3 反签 4独家 5合作方
6APP盘下载方 7APP客下载方
',
//`agent_id`'分佣经纪人id',
//`agent_id`'分佣经纪人id',
//`scale`'分佣比例 如 5表示百分之5',
//`scale`'分佣比例 如 5表示百分之5',
// `scale_fee` '应分佣金 存分 ',
// `scale_fee` '应分佣金 存分 ',
...
@@ -247,12 +248,14 @@ class OrderLog extends Basic
...
@@ -247,12 +248,14 @@ class OrderLog extends Basic
$house_number
=
!
isset
(
$params
[
"house_number"
])
?
null
:
$params
[
"house_number"
];
$house_number
=
!
isset
(
$params
[
"house_number"
])
?
null
:
$params
[
"house_number"
];
$is_open
=
!
isset
(
$params
[
"is_open"
])
?
0
:
$params
[
"is_open"
];
$is_open
=
!
isset
(
$params
[
"is_open"
])
?
0
:
$params
[
"is_open"
];
$industry_type
=
!
isset
(
$params
[
"industry_type"
])
?
null
:
$params
[
"industry_type"
];
$industry_type
=
!
isset
(
$params
[
"industry_type"
])
?
null
:
$params
[
"industry_type"
];
$estimated_receipt_date
=
$params
[
"estimated_receipt_date"
];
$params
[
"commission_arr"
]
=
json_decode
(
$params
[
"commission_arr"
],
true
);
$params
[
"commission_arr"
]
=
json_decode
(
$params
[
"commission_arr"
],
true
);
$is_ok
=
$this
->
service_
->
addBargain
(
$params
[
"submit_agent_id"
],
$params
[
"submit_agent_name"
],
$params
[
"report_id"
],
$params
[
"order_id"
],
$params
[
"order_no"
],
$is_ok
=
$this
->
service_
->
addBargain
(
$params
[
"submit_agent_id"
],
$params
[
"submit_agent_name"
],
$params
[
"report_id"
],
$params
[
"trade_type"
],
$params
[
"price"
],
$params
[
"commission"
],
$params
[
"commission_arr"
],
$house_number
,
$is_open
,
$industry_type
);
$params
[
"order_id"
],
$params
[
"order_no"
],
$params
[
"trade_type"
],
$params
[
"price"
],
$params
[
"commission"
],
$params
[
"commission_arr"
],
$house_number
,
$is_open
,
$industry_type
,
$estimated_receipt_date
);
if
(
$is_ok
>
0
)
{
if
(
$is_ok
>
0
)
{
//todo 更改用户信息 求租->已租
//todo 更改用户信息 求租->已租
...
...
application/api_broker/service/OrderLogService.php
View file @
7add9f4f
...
@@ -124,13 +124,14 @@ class OrderLogService
...
@@ -124,13 +124,14 @@ class OrderLogService
* @param $house_number
* @param $house_number
* @param $is_open
* @param $is_open
* @param $industry_type
* @param $industry_type
* @param $estimated_receipt_date
* @return int|string
* @return int|string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
addBargain
(
$submit_agent_id
,
$submit_agent_name
,
$report_id
,
$order_id
,
$order_no
,
$trade_type
,
$price
,
public
function
addBargain
(
$submit_agent_id
,
$submit_agent_name
,
$report_id
,
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
,
$commission_arr
,
$house_number
,
$is_open
,
$industry_type
)
$commission
,
$commission_arr
,
$house_number
,
$is_open
,
$industry_type
,
$estimated_receipt_date
)
{
{
$bargain_arr
=
[];
$bargain_arr
=
[];
$father_id
=
0
;
$father_id
=
0
;
...
@@ -140,11 +141,11 @@ class OrderLogService
...
@@ -140,11 +141,11 @@ class OrderLogService
&&
isset
(
$commission_val
[
"scale_fee"
]))
{
&&
isset
(
$commission_val
[
"scale_fee"
]))
{
if
(
$father_id
==
0
)
{
if
(
$father_id
==
0
)
{
$params
=
$this
->
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$submit_agent_name
,
$report_id
,
$order_id
,
$params
=
$this
->
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$submit_agent_name
,
$report_id
,
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
,
$house_number
,
$is_open
,
$industry_type
);
$order_no
,
$trade_type
,
$price
,
$commission
,
$house_number
,
$is_open
,
$industry_type
,
$estimated_receipt_date
);
$father_id
=
$this
->
bargainModel
->
insertBargain
(
$params
);
$father_id
=
$this
->
bargainModel
->
insertBargain
(
$params
);
}
else
{
}
else
{
array_push
(
$bargain_arr
,
$this
->
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$submit_agent_name
,
$report_id
,
array_push
(
$bargain_arr
,
$this
->
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$submit_agent_name
,
$report_id
,
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
,
$house_number
,
$is_open
,
$industry_type
));
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
,
$house_number
,
$is_open
,
$industry_type
,
$estimated_receipt_date
));
}
}
}
}
array_push
(
$agent_arr
,
[
$commission_val
[
"agent_id"
]
]);
array_push
(
$agent_arr
,
[
$commission_val
[
"agent_id"
]
]);
...
@@ -166,7 +167,7 @@ class OrderLogService
...
@@ -166,7 +167,7 @@ class OrderLogService
}
}
private
function
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$submit_agent_name
,
$report_id
,
$order_id
,
private
function
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$submit_agent_name
,
$report_id
,
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
,
$house_number
,
$is_open
,
$industry_type
)
$order_no
,
$trade_type
,
$price
,
$commission
,
$house_number
,
$is_open
,
$industry_type
,
$estimated_receipt_date
)
{
{
$arr
[
"report_id"
]
=
$report_id
;
$arr
[
"report_id"
]
=
$report_id
;
$arr
[
"father_id"
]
=
$father_id
;
$arr
[
"father_id"
]
=
$father_id
;
...
@@ -185,6 +186,7 @@ class OrderLogService
...
@@ -185,6 +186,7 @@ class OrderLogService
$arr
[
"is_open"
]
=
$is_open
;
$arr
[
"is_open"
]
=
$is_open
;
$arr
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$arr
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$arr
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$arr
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$arr
[
"estimated_receipt_date"
]
=
$estimated_receipt_date
;
$arr
[
"industry_type"
]
=
$industry_type
;
$arr
[
"industry_type"
]
=
$industry_type
;
return
$arr
;
return
$arr
;
}
}
...
@@ -834,7 +836,7 @@ class OrderLogService
...
@@ -834,7 +836,7 @@ class OrderLogService
$arr
[
"cash"
]
=
$value
[
"cash"
];
$arr
[
"cash"
]
=
$value
[
"cash"
];
$arr
[
"practical_fee"
]
=
$value
[
"practical_fee"
];
$arr
[
"practical_fee"
]
=
$value
[
"practical_fee"
];
$arr
[
"service_charge"
]
=
$value
[
"service_charge"
];
$arr
[
"service_charge"
]
=
$value
[
"service_charge"
];
if
(
!
empty
(
$value
[
"real_fee"
])
&&
!
empty
(
$value
[
"create_time"
]))
{
//过滤掉空的
if
(
!
empty
(
$value
[
"real_fee"
])
&&
!
empty
(
$value
[
"create_time"
]))
{
//过滤掉空的
$cent_commission
[
"info"
][
$key
]
=
$arr
;
$cent_commission
[
"info"
][
$key
]
=
$arr
;
}
}
...
@@ -992,6 +994,17 @@ class OrderLogService
...
@@ -992,6 +994,17 @@ class OrderLogService
case
5
:
case
5
:
return
null
;
return
null
;
break
;
break
;
case
6
:
return
null
;
break
;
case
7
:
$userModel
=
new
Users
();
$params
[
"a.id"
]
=
$result
[
0
][
"user_id"
];
$params
[
"a.referrer_source"
]
=
20
;
$params
[
"a.status"
]
=
0
;
$params
[
"b.status"
]
=
0
;
$list
=
$userModel
->
getAgentByReferrer
(
$field
,
$params
);
break
;
default
:
default
:
return
null
;
return
null
;
...
...
application/model/Users.php
View file @
7add9f4f
...
@@ -575,6 +575,15 @@ class Users extends Model
...
@@ -575,6 +575,15 @@ class Users extends Model
->
where
(
$params
)
->
where
(
$params
)
->
select
();
->
select
();
}
}
public
function
getAgentByReferrer
(
$field
,
$params
)
{
return
Db
::
name
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"a_agents b"
,
"a.referrer_id=b.id"
,
"left"
)
->
where
(
$params
)
->
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