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
83c1e93a
Commit
83c1e93a
authored
Aug 26, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纪人列表 v2版本
parent
2801674f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
350 additions
and
147 deletions
+350
-147
Broker.php
application/api_broker/controller/Broker.php
+24
-2
CellPhone.php
application/api_broker/controller/CellPhone.php
+1
-0
LookShop.php
application/api_broker/controller/LookShop.php
+63
-1
Performance.php
application/api_broker/controller/Performance.php
+111
-111
User.php
application/api_broker/controller/User.php
+16
-6
LookShopService.php
application/api_broker/service/LookShopService.php
+11
-0
PerformanceService.php
application/api_broker/service/PerformanceService.php
+87
-27
AAgents.php
application/model/AAgents.php
+36
-0
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/Broker.php
View file @
83c1e93a
...
...
@@ -14,6 +14,8 @@ use app\api\untils\JwtUntils;
use
app\api\untils\MessageUntils
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\BrokerService
;
use
app\api_broker\service\CallPhoneService
;
use
app\api_broker\service\ClientService
;
use
app\api_broker\service\OrderLogService
;
use
app\model\AAgents
;
use
app\model\ABindingDevice
;
...
...
@@ -383,8 +385,9 @@ class Broker extends Basic
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/* $params = array(
"user_id" => 828
/* $params = array(
"user_id" => 828,
"agent_id" => 1,
);*/
if
(
!
isset
(
$params
[
'user_id'
]))
{
...
...
@@ -492,6 +495,25 @@ class Broker extends Basic
$data
[
'user_invite_info'
]
=
$user_invite_info
;
/*查询客户邀请人 end*/
// 判断当天被拨打是否超过5次,同时判断是否当前经纪人跟当前客户是否有电话绑定
$data
[
'is_outpace_call_num'
]
=
0
;
$clientService
=
new
ClientService
();
if
(
!
$clientService
->
dialTotal
(
$params
[
"user_id"
]))
{
$data
[
'is_outpace_call_num'
]
=
1
;
}
$model
=
new
AAgents
();
$result
=
$model
->
searchAgentsByKeyword
(
"id,name,phone"
,
[
"id"
=>
$params
[
"agent_id"
]]);
$call
=
new
CallPhoneService
();
$result
=
$call
->
getBindNum
(
$user_res
[
'user_phone'
],
$result
[
0
][
'phone'
]);
if
(
$result
!=
0
){
$data
[
'is_outpace_call_num'
]
=
0
;
}
return
$this
->
response
(
"200"
,
"success!"
,
$data
);
}
...
...
application/api_broker/controller/CellPhone.php
View file @
83c1e93a
...
...
@@ -30,6 +30,7 @@ class CellPhone extends Basic
{
header
(
'Access-Control-Allow-Origin:*'
);
$call
=
new
CallPhoneService
();
$record
=
true
;
//是否录音
$user_id
=
empty
(
$this
->
params
[
'user_id'
])
?
0
:
(
int
)
$this
->
params
[
'user_id'
];
...
...
application/api_broker/controller/LookShop.php
View file @
83c1e93a
...
...
@@ -6,6 +6,7 @@ use app\api_broker\extend\Basic;
use
app\api_broker\service\LookShopService
;
use
app\model\AAgents
;
use
app\model\SystemConfig
;
use
think\Log
;
use
think\Request
;
/**
...
...
@@ -62,7 +63,7 @@ class LookShop extends Basic
public
function
getAgentsResidueNumList
()
{
$params
=
$this
->
params
;
/*
$params = array(
/*$params = array(
"store_id" => 1,
);*/
if
(
!
isset
(
$params
[
"store_id"
])
&&
$params
[
"store_id"
]
<=
0
)
{
...
...
@@ -97,4 +98,64 @@ class LookShop extends Basic
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
/**
* 经纪人列表 v2版本
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentsResidueNumListV2
()
{
$params
=
$this
->
params
;
//$params['agent_id']=80;
$page_no
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$page_size
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$model
=
new
AAgents
();
//$params_["id"] = $params['agent_id'];
$params_
[
"id"
]
=
$this
->
agentId
;
$result
=
$model
->
searchAgentsByKeyword
(
"id,store_id,district_id,level"
,
$params_
);
$field
=
"id,store_id,level,name,phone,img"
;
//店长
if
(
$result
[
0
][
"level"
]
==
20
){
$where_
[
"store_id"
]
=
$result
[
0
][
"store_id"
];
}
else
{
//总监
$where_
[
"district_id"
]
=
$result
[
0
][
"district_id"
];
}
$where_
[
"status"
]
=
0
;
$agentList
=
$this
->
agentsModel
->
getAgentByIdV2
(
$field
,
$where_
,
$page_no
,
$page_size
);
if
(
count
(
$agentList
)
<=
0
)
{
return
$this
->
response
(
"200"
,
"request null"
);
}
$systemConfigModel
=
new
SystemConfig
();
$lookNum
=
0
;
$data
=
$systemConfigModel
->
getSetting
([
"config_type"
=>
40
],
"rule"
);
if
(
$data
&&
$data
[
"agent_shop_num"
]
>
0
)
{
$lookNum
=
$data
[
"agent_shop_num"
];
}
foreach
(
$agentList
as
$key
=>
$item
)
{
Log
::
write
(
$item
[
"id"
],
'看铺经纪人ID'
);
//记录日志
$residue_num
=
$this
->
lookShopService_
->
isLookShop
(
$item
[
"id"
]);
Log
::
write
(
$residue_num
,
'residue_num看铺-升级'
);
//记录日志
if
(
$residue_num
<=
0
)
{
//是否升级
$agentList
[
$key
][
"is_upgrade"
]
=
true
;
}
else
{
$agentList
[
$key
][
"is_upgrade"
]
=
false
;
}
}
$result
[
"look_num"
]
=
$lookNum
;
$result
[
"list"
]
=
$agentList
;
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
}
\ No newline at end of file
application/api_broker/controller/Performance.php
View file @
83c1e93a
...
...
@@ -549,122 +549,122 @@ class Performance extends Basic
}
}
//TODO 报备
// public function followListPcInfo()
// {
// header('Access-Control-Allow-Origin:*');
// $params = $this->params;
// $params = array(
// //"id" => 80,
// //"type" => 1, //1表示个人业绩排行 2门店 3区域
//
// //"id" => 79,
// //"type" => 2, //1表示个人业绩排行 2门店 3区域
//
// "id" => 7,
// "type" => 3, //1表示个人业绩排行 2门店 3区域
//
// "start_time" => "2018-06-12",
// "end_time" => "2018-06-19",
// "page_no" => 1,
// "page_size" => 15
// );
//
//// $checkResult = $this->validate($params, "PerformanceValidate.verifyOther");
//// if (true !== $checkResult) {
//// return $this->response("101", $checkResult);
//// }
// //默认排序一周
// $end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
// $start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
//
// $page_no = empty($params['page_no']) ? 1 : $params['page_no'];
// $page_size = empty($params['page_size']) ? 15 : $params['page_size'];
//
// $result = $this->service_->getFollowList($params["agent_id"], $start_day, $end_day, $page_no, $page_size);
// if ($result["code"] == 101) {
// return $this->response("101", $result["date"]);
// } else {
// return $this->response("200", "success", $result["date"]);
public
function
followListPcInfo
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*$params = array(
//"id" => 80,
//"type" => 1, //1表示个人业绩排行 2门店 3区域
//"id" => 79,
//"type" => 2, //1表示个人业绩排行 2门店 3区域
"id" => 7,
"type" => 3, //1表示个人业绩排行 2门店 3区域
"start_time" => "2018-06-12",
"end_time" => "2018-06-19",
"page_no" => 1,
"page_size" => 15
);*/
// $checkResult = $this->validate($params, "PerformanceValidate.verifyOther");
// if (true !== $checkResult) {
// return $this->response("101", $checkResult);
// }
// }
//默认排序一周
$end_day
=
!
empty
(
$params
[
"end_time"
])
?
$params
[
"end_time"
]
:
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
));
$start_day
=
!
empty
(
$params
[
"start_time"
])
?
$params
[
"start_time"
]
:
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$page_no
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$page_size
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$result
=
$this
->
service_
->
getFollowListPcInfo
(
$params
[
"id"
],
$params
[
"type"
],
$start_day
,
$end_day
,
$page_no
,
$page_size
);
if
(
$result
[
"code"
]
==
101
)
{
return
$this
->
response
(
"101"
,
$result
[
"date"
]);
}
else
{
return
$this
->
response
(
"200"
,
"success"
,
$result
[
"date"
]);
}
}
// //TODO 新增商铺
// public function housingResourcePcInfo()
// {
// header('Access-Control-Allow-Origin:*');
// $params = $this->params;
// $params = array(
// //"id" => 80,
// //"type" => 1, //1表示个人业绩排行 2门店 3区域
//
// //"id" => 79,
// //"type" => 2, //1表示个人业绩排行 2门店 3区域
//
// "id" => 7,
// "type" => 3, //1表示个人业绩排行 2门店 3区域
//
// "start_time" => "2018-06-12",
// "end_time" => "2018-06-19",
// "page_no" => 1,
// "page_size" => 15
// );
//
//// $checkResult = $this->validate($params, "PerformanceValidate.verify");
//// if (true !== $checkResult) {
//// return $this->response("101", $checkResult);
//// }
// //默认排序一周
// $end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
// $start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
//
// $page_no = empty($params['page_no']) ? 1 : $params['page_no'];
// $page_size = empty($params['page_size']) ? 15 : $params['page_size'];
//
// $result = $this->service_->getHousingResourceList($params["type"], $params["agent_id"], $start_day, $end_day, $page_no, $page_size);
// if ($result["code"] == 101) {
// return $this->response("101", $result["date"]);
// } else {
// return $this->response("200", "success", $result["date"]);
public
function
housingResourcePcInfo
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*$params = array(
//"id" => 80,
//"type" => 1, //1表示个人业绩排行 2门店 3区域
//"id" => 79,
//"type" => 2, //1表示个人业绩排行 2门店 3区域
"id" => 7,
"type" => 3, //1表示个人业绩排行 2门店 3区域
"start_time" => "2018-06-12",
"end_time" => "2018-06-19",
"page_no" => 1,
"page_size" => 15
);*/
// $checkResult = $this->validate($params, "PerformanceValidate.verify");
// if (true !== $checkResult) {
// return $this->response("101", $checkResult);
// }
// }
//默认排序一周
$end_day
=
!
empty
(
$params
[
"end_time"
])
?
$params
[
"end_time"
]
:
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
));
$start_day
=
!
empty
(
$params
[
"start_time"
])
?
$params
[
"start_time"
]
:
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$page_no
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$page_size
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$result
=
$this
->
service_
->
getHousingResourceListPcInfo
(
$params
[
"id"
],
$params
[
"type"
],
$start_day
,
$end_day
,
$page_no
,
$page_size
);
if
(
$result
[
"code"
]
==
101
)
{
return
$this
->
response
(
"101"
,
$result
[
"date"
]);
}
else
{
return
$this
->
response
(
"200"
,
"success"
,
$result
[
"date"
]);
}
}
// //TODO 新增客户
// public function userResourcePcInfo()
// {
// header('Access-Control-Allow-Origin:*');
// $params = $this->params;
// $params = array(
// //"id" => 80,
// //"type" => 1, //1表示个人业绩排行 2门店 3区域
//
// //"id" => 79,
// //"type" => 2, //1表示个人业绩排行 2门店 3区域
//
// "id" => 7,
// "type" => 3, //1表示个人业绩排行 2门店 3区域
//
// "start_time" => "2018-06-12",
// "end_time" => "2018-06-19",
// "page_no" => 1,
// "page_size" => 15
// );
//
//// $checkResult = $this->validate($params, "PerformanceValidate.verify");
//// if (true !== $checkResult) {
//// return $this->response("101", $checkResult);
//// }
// //默认排序一周
// $end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
// $start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
//
// $page_no = empty($params['page_no']) ? 1 : $params['page_no'];
// $page_size = empty($params['page_size']) ? 15 : $params['page_size'];
//
// $result = $this->service_->getUserResourceList($params["type"], $params["agent_id"], $start_day, $end_day, $page_no, $page_size);
// if ($result["code"] == 101) {
// return $this->response("101", $result["date"]);
// } else {
// return $this->response("200", "success", $result["date"]);
public
function
userResourcePcInfo
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/* $params = array(
//"id" => 80,
//"type" => 1, //1表示个人业绩排行 2门店 3区域
//"id" => 79,
//"type" => 2, //1表示个人业绩排行 2门店 3区域
"id" => 7,
"type" => 3, //1表示个人业绩排行 2门店 3区域
"start_time" => "2018-06-12",
"end_time" => "2018-06-19",
"page_no" => 1,
"page_size" => 15
);*/
// $checkResult = $this->validate($params, "PerformanceValidate.verify");
// if (true !== $checkResult) {
// return $this->response("101", $checkResult);
// }
// }
//默认排序一周
$end_day
=
!
empty
(
$params
[
"end_time"
])
?
$params
[
"end_time"
]
:
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
));
$start_day
=
!
empty
(
$params
[
"start_time"
])
?
$params
[
"start_time"
]
:
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$page_no
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$page_size
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$result
=
$this
->
service_
->
getUserResourceListPcInfo
(
$params
[
"id"
],
$params
[
"type"
],
$start_day
,
$end_day
,
$page_no
,
$page_size
);
if
(
$result
[
"code"
]
==
101
)
{
return
$this
->
response
(
"101"
,
$result
[
"date"
]);
}
else
{
return
$this
->
response
(
"200"
,
"success"
,
$result
[
"date"
]);
}
}
//TODO 团队人数
}
application/api_broker/controller/User.php
View file @
83c1e93a
...
...
@@ -3,6 +3,7 @@
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\CallPhoneService
;
use
app\api_broker\service\ClientService
;
use
app\api_broker\service\UserExpiredTimeService
;
use
app\api_broker\service\VipService
;
...
...
@@ -444,9 +445,14 @@ class User extends Basic
return
$this
->
response
(
"201"
,
"查无数据"
,
[
'user_id'
=>
$params
[
'user_id'
]
]);
}
$model
=
new
AAgents
();
$result
=
$model
->
searchAgentsByKeyword
(
"id,name,phone"
,
[
"id"
=>
$params
[
"agent_id"
]]);
$call
=
new
CallPhoneService
();
$gresult
=
$call
->
getBindNum
(
$user_res
[
'user_phone'
],
$result
[
0
][
'phone'
]);
// 判断当天被拨打是否超过5次
$clientService
=
new
ClientService
();
if
(
!
$clientService
->
dialTotal
(
$user_res
[
0
][
'id'
]))
{
if
(
!
$clientService
->
dialTotal
(
$user_res
[
0
][
'id'
])
&&
$gresult
==
0
)
{
return
$this
->
response
(
"201"
,
"当天被拨打超过5次"
,
[
'user_id'
=>
$user_res
[
0
][
'id'
]
]);
}
...
...
@@ -599,7 +605,7 @@ class User extends Basic
$where
[
'a.id'
]
=
[
'lt'
,
$params
[
'id'
]
];
$order
=
'a.id desc'
;
}
$field
=
'a.id,a.user_id,b.user_nick,b.agent_id,b.vip,b.create_time'
;
$field
=
'a.id,a.user_id,b.user_nick,b.
user_nick,b.
agent_id,b.vip,b.create_time'
;
$model
=
new
UPhoneFollowPp
();
$model_res
=
$model
->
getLastOrNextUserIDPhoneFollowP
(
$where
,
$field
,
$limit
=
1
,
$order
);
...
...
@@ -608,10 +614,14 @@ class User extends Basic
}
// 判断当天被拨打是否超过5次
// $clientService = new ClientService();
// if (!$clientService->dialTotal($model_res[0]['user_id'])) {
// return $this->response("201", "当天被拨打超过5次", ['user_id'=>$model_res[0]['id']]);
// }
$model
=
new
AAgents
();
$result
=
$model
->
searchAgentsByKeyword
(
"id,name,phone"
,
[
"id"
=>
$params
[
"agent_id"
]]);
$call
=
new
CallPhoneService
();
$gresult
=
$call
->
getBindNum
(
$model_res
[
'user_phone'
],
$result
[
0
][
'phone'
]);
$clientService
=
new
ClientService
();
if
(
!
$clientService
->
dialTotal
(
$model_res
[
0
][
'user_id'
])
&&
$gresult
==
0
)
{
return
$this
->
response
(
"201"
,
"当天被拨打超过5次"
,
[
'user_id'
=>
$model_res
[
0
][
'id'
]]);
}
//如果非客方
if
(
$model_res
[
0
][
'agent_id'
]
!=
$params
[
'agent_id'
])
{
...
...
application/api_broker/service/LookShopService.php
View file @
83c1e93a
...
...
@@ -190,4 +190,14 @@ class LookShopService
$this
->
redis
->
hSet
(
self
::
LOOK_UP_NUM
.
$this
->
nowTime
,
$agent_id
,
$upLookNum
);
return
true
;
}
public
function
getAgentUpNum
(
int
$agent_id
)
:
bool
{
$agentUpNum
=
$this
->
redis
->
hGet
(
self
::
LOOK_UP_NUM
.
$this
->
nowTime
,
$agent_id
);
return
$agentUpNum
;
}
}
\ No newline at end of file
application/api_broker/service/PerformanceService.php
View file @
83c1e93a
...
...
@@ -517,6 +517,7 @@ class PerformanceService
return
[
"code"
=>
200
,
"date"
=>
$addUserList
];
}
/**
* 获取带看数据
* @param $agent_id
...
...
@@ -565,21 +566,7 @@ class PerformanceService
return
[
"code"
=>
200
,
"date"
=>
$addMarchInList
];
}
public
function
marchInListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
//dump($params);
if
(
!
$params
)
return
[
"code"
=>
101
,
"date"
=>
"传入的参数错误"
];
$field
=
"a.id,c.user_name,c.user_phone,c.predict_see_time,c.report_agent_name,b.house_title,e.store_name"
;
$addMarchInList
=
$this
->
marchInModel
->
getAddMarchInListPcInfo
(
$params
,
$field
,
$page_no
,
$page_size
);
//获取图片信息
foreach
(
$addMarchInList
as
$key
=>
$val
)
{
$addMarchInList
[
$key
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$val
[
"user_phone"
]);
}
return
[
"code"
=>
200
,
"date"
=>
$addMarchInList
];
}
/**
* 获取收款数据
...
...
@@ -605,20 +592,7 @@ class PerformanceService
return
[
"code"
=>
200
,
"date"
=>
$payLogList
];
}
public
function
paylogListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
if
(
!
$params
)
return
[
"code"
=>
101
,
"date"
=>
"传入的参数错误"
];
$field
=
"a.id,a.create_time,a.money,a.type,a.pay_type,c.user_name,c.user_phone,c.predict_see_time,b.house_title,h.landmark"
;
$payLogList
=
$this
->
payLogModel
->
getAddPayLogListPcInfo
(
$params
,
$field
,
$page_no
,
$page_size
);
//获取图片信息
foreach
(
$payLogList
as
$key
=>
$val
)
{
$payLogList
[
$key
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$val
[
"user_phone"
]);
}
return
[
"code"
=>
200
,
"date"
=>
$payLogList
];
}
/**
* 获取业绩数据
...
...
@@ -690,4 +664,89 @@ class PerformanceService
return
[
"code"
=>
200
,
"date"
=>
$receivedList
];
}
public
function
paylogListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
if
(
!
$params
)
return
[
"code"
=>
101
,
"date"
=>
"传入的参数错误"
];
$field
=
"a.id,a.create_time,a.money,a.type,a.pay_type,c.user_name,c.user_phone,c.predict_see_time,b.house_title,h.landmark"
;
$payLogList
=
$this
->
payLogModel
->
getAddPayLogListPcInfo
(
$params
,
$field
,
$page_no
,
$page_size
);
//获取图片信息
foreach
(
$payLogList
as
$key
=>
$val
)
{
$payLogList
[
$key
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$val
[
"user_phone"
]);
}
return
[
"code"
=>
200
,
"date"
=>
$payLogList
];
}
public
function
marchInListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
//dump($params);
if
(
!
$params
)
return
[
"code"
=>
101
,
"date"
=>
"传入的参数错误"
];
$field
=
"a.id,c.user_name,c.user_phone,c.predict_see_time,c.report_agent_name,b.house_title,e.store_name"
;
$addMarchInList
=
$this
->
marchInModel
->
getAddMarchInListPcInfo
(
$params
,
$field
,
$page_no
,
$page_size
);
//获取图片信息
foreach
(
$addMarchInList
as
$key
=>
$val
)
{
$addMarchInList
[
$key
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$val
[
"user_phone"
]);
}
return
[
"code"
=>
200
,
"date"
=>
$addMarchInList
];
}
public
function
getUserResourceListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
if
(
!
$params
)
return
[
"code"
=>
101
,
"date"
=>
"传入的参数错误"
];
$field
=
"id,user_name,user_phone,user_nick,create_time,agent_id"
;
$addUserList
=
$this
->
userModel
->
getAddUserList
(
$params
,
$field
,
$page_no
,
$page_size
);
foreach
(
$addUserList
as
$key
=>
$val
)
{
if
(
$val
[
"agent_id"
]
==
$id
)
{
$addUserList
[
$key
][
"is_my"
]
=
1
;
}
else
{
$addUserList
[
$key
][
"is_my"
]
=
0
;
}
$addUserList
[
$key
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$val
[
"user_phone"
]);
}
return
[
"code"
=>
200
,
"date"
=>
$addUserList
];
}
public
function
getHousingResourceListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
if
(
!
$params
)
return
[
"code"
=>
101
,
"date"
=>
"传入的参数错误"
];
$field
=
"id,internal_title,shop_area_start,shop_area_end,rent_type,rent_price,shop_type,shop_sign"
;
$addHouseList
=
$this
->
houseModel
->
getAddHouseList
(
$params
,
$field
,
$page_no
,
$page_size
);
//获取图片信息
foreach
(
$addHouseList
as
$key
=>
$val
)
{
$addHouseList
[
$key
][
"rent_price"
]
=
$val
[
"rent_price"
]
*
0.01
;
$param
[
"house_id"
]
=
$val
[
"id"
];
$param
[
"img_type"
]
=
1
;
//默认主图
$imgArr
=
$this
->
gHousesImgModel
->
getHouseImages
(
$param
,
1
);
$addHouseList
[
$key
][
"images"
]
=
!
empty
(
$imgArr
[
0
][
"img_name"
])
?
CK_IMG_URL
.
'images/'
.
$imgArr
[
0
][
"img_name"
]
:
null
;
}
return
[
"code"
=>
200
,
"date"
=>
$addHouseList
];
}
public
function
getFollowListPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
,
$page_no
,
$page_size
)
{
$params
=
$this
->
getAgentIdPcInfo
(
$id
,
$type
,
$start_time
,
$end_time
);
if
(
!
$params
)
return
[
"code"
=>
101
,
"date"
=>
"传入的参数错误"
];
$field
=
"a.id,a.user_name,a.user_phone,a.predict_see_time,c.internal_title as house_title,c.shop_type"
;
$reportList
=
$this
->
reportModel
->
getAddReportList
(
$params
,
$field
,
$page_no
,
$page_size
);
foreach
(
$reportList
as
$key
=>
$val
)
{
$reportList
[
$key
][
"user_phone"
]
=
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$val
[
"user_phone"
]);
}
return
[
"code"
=>
200
,
"date"
=>
$reportList
];
}
}
\ No newline at end of file
application/model/AAgents.php
View file @
83c1e93a
...
...
@@ -291,6 +291,42 @@ class AAgents extends BaseModel
return
$result
;
}
public
function
getAgentByIdV2
(
$field
=
"id"
,
$params
,
$page_no
,
$page_size
)
{
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"name"
]))
{
$where_
[
"name"
]
=
$params
[
"name"
];
}
if
(
isset
(
$params
[
"phone"
]))
{
$where_
[
"phone"
]
=
$params
[
"phone"
];
}
if
(
isset
(
$params
[
"store_id"
]))
{
$where_
[
"store_id"
]
=
$params
[
"store_id"
];
}
if
(
isset
(
$params
[
"district_id"
]))
{
$where_
[
"district_id"
]
=
$params
[
"district_id"
];
}
if
(
isset
(
$params
[
"status"
]))
{
$where_
[
"status"
]
=
$params
[
"status"
];
}
if
(
isset
(
$params
[
"level"
]))
{
$where_
[
"level"
]
=
$params
[
"level"
];
}
if
(
isset
(
$params
[
'in_id'
]))
{
$where_
[
'id'
]
=
[
'in'
,
$params
[
'in_id'
]
];
}
$result
=
$this
->
field
(
$field
)
->
where
(
$where_
)
->
limit
(
$page_size
)
->
page
(
$page_no
)
->
select
();
// echo $this->getLastSql();
return
$result
;
}
/**
* 修改密码
*
...
...
application/route.php
View file @
83c1e93a
...
...
@@ -530,6 +530,7 @@ Route::group('broker', [
'editDecFeedClick'
=>
[
'api_broker/Feed/editDecFeedClick'
,
[
'method'
=>
'post'
]
],
//feed流喜报详情
'getAgentsResidueNumList'
=>
[
'api_broker/LookShop/getAgentsResidueNumList'
,
[
'method'
=>
'get'
]
],
//剩余铺数列表
'getAgentsResidueNumListV2'
=>
[
'api_broker/LookShop/getAgentsResidueNumListV2'
,
[
'method'
=>
'get'
]
],
//剩余铺数列表
'setAgentLookNum'
=>
[
'api_broker/LookShop/setAgentLookNum'
,
[
'method'
=>
'post'
]
],
//设置经纪人的看铺数量
//首页跟进记录
...
...
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