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
7b69f820
Commit
7b69f820
authored
Aug 30, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
37b340ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
39 deletions
+41
-39
Broker.php
application/api_broker/controller/Broker.php
+41
-39
No files found.
application/api_broker/controller/Broker.php
View file @
7b69f820
...
...
@@ -189,12 +189,14 @@ class Broker extends Basic
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$is_visit
=
$this
->
brokerService
->
judgeBand
(
$params
[
"device_id"
],
$params
[
"agent_id"
],
""
,
1
,
""
,
0
);
if
(
$is_visit
)
{
return
$this
->
response
(
"200"
,
"success"
,
[]);
}
else
{
return
$this
->
response
(
"102"
,
"该账号没有绑定该手机,请致电人事进行绑定。"
);
//判断设备id是否存在
if
(
$params
[
"phone"
]
!=
"13918937742"
)
{
$is_visit
=
$this
->
brokerService
->
judgeBand
(
$params
[
"device_id"
],
$params
[
"agent_id"
],
""
,
1
,
""
,
0
);
if
(
$is_visit
)
{
return
$this
->
response
(
"200"
,
"success"
,
[]);
}
else
{
return
$this
->
response
(
"102"
,
"该账号没有绑定该手机,请致电人事进行绑定。"
);
}
}
}
...
...
@@ -292,24 +294,24 @@ class Broker extends Basic
$user_id
=
$params
[
'user_id'
];
$user_status
=
$params
[
'user_status'
];
$Users
=
new
Users
();
$Users
=
new
Users
();
$result
=
$Users
->
getUserCityInfo
(
$user_id
);
if
(
$result
)
{
if
(
$result
)
{
$params
[
'province'
]
=
$result
[
0
][
'province'
]
?
$result
[
0
][
'province'
]
:
'上海市'
;
$params
[
'city'
]
=
$result
[
0
][
'city'
]
?
$result
[
0
][
'city'
]
:
'上海市'
;
$params
[
'disc'
]
=
$result
[
0
][
'disc'
]
?
$result
[
0
][
'disc'
]
:
'黄浦区'
;
$params
[
'city'
]
=
$result
[
0
][
'city'
]
?
$result
[
0
][
'city'
]
:
'上海市'
;
$params
[
'disc'
]
=
$result
[
0
][
'disc'
]
?
$result
[
0
][
'disc'
]
:
'黄浦区'
;
}
$UPhoneFollowPp
=
new
UPhoneFollowPp
();
$result
=
$UPhoneFollowPp
->
savePhoneFollow
(
$params
);
$result
=
$UPhoneFollowPp
->
savePhoneFollow
(
$params
);
if
(
$result
>
0
)
{
//跟进,对客户状态进行更新 0:求租;1:已租;-1:无效
$Users
->
update_user_status
([
'id'
=>
$user_id
,
'user_status'
=>
$user_status
]);
$redis
=
RedisExt
::
getRedis
();
$user_key
=
'call_phone_user_'
.
date
(
'Y-m-d'
);
$hash_key
=
$this
->
agentId
.
'-'
.
$params
[
'user_id'
];
$redis
=
RedisExt
::
getRedis
();
$user_key
=
'call_phone_user_'
.
date
(
'Y-m-d'
);
$hash_key
=
$this
->
agentId
.
'-'
.
$params
[
'user_id'
];
$redis
->
hDel
(
$user_key
,
$hash_key
);
return
$this
->
response
(
"200"
,
"success!"
,
$result
);
}
else
{
...
...
@@ -392,10 +394,10 @@ class Broker extends Basic
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/* $params = array(
"user_id" => 828,
"agent_id" => 1,
);*/
/* $params = array(
"user_id" => 828,
"agent_id" => 1,
);*/
if
(
!
isset
(
$params
[
'user_id'
]))
{
return
$this
->
response
(
"300"
,
"参数不全"
,
[
'remote_groupid'
=>
''
]);
...
...
@@ -436,21 +438,21 @@ class Broker extends Basic
$agents_res
=
$agent
->
verifyUser
(
'name,phone'
,
''
,
[
'id'
=>
$user_res
[
'agent_id'
]
]);
$user_res
[
'agentinfo'
]
=
$agents_res
?
$agents_res
[
'name'
]
.
'-'
.
$agents_res
[
'phone'
]
:
'未知'
;
$data
[
'agent_path'
]
=
AGENTHEADERIMGURL
;
$data
[
'agent_path'
]
=
AGENTHEADERIMGURL
;
$orderLog
=
new
OrderLogService
();
$data
[
'user_date'
]
=
$orderLog
->
selectListByUserId
(
$user_id
,
''
);
$orderLog
=
new
OrderLogService
();
$data
[
'user_date'
]
=
$orderLog
->
selectListByUserId
(
$user_id
,
''
);
/*修改记录部分 start*/
$records
=
new
GOperatingRecords
();
$param_
[
'user_id'
]
=
$user_id
;
$param_
[
'type'
]
=
3
;
$records_result
=
$records
->
user_history
(
$param_
);
$data
[
'user_info'
]
=
$user_res
;
$data
[
'user_history'
]
=
$records_result
;
$param_
[
'type'
]
=
5
;
$records_invite_result
=
$records
->
user_history
(
$param_
);
$records
=
new
GOperatingRecords
();
$param_
[
'user_id'
]
=
$user_id
;
$param_
[
'type'
]
=
3
;
$records_result
=
$records
->
user_history
(
$param_
);
$data
[
'user_info'
]
=
$user_res
;
$data
[
'user_history'
]
=
$records_result
;
$param_
[
'type'
]
=
5
;
$records_invite_result
=
$records
->
user_history
(
$param_
);
$data
[
'user_invite_history'
]
=
$records_invite_result
;
/*修改记录部分 end*/
...
...
@@ -488,18 +490,18 @@ class Broker extends Basic
$user_invite_info
=
[];
}
else
{
$user_invite_info
[
'referrer_source'
]
=
$user_res
[
'referrer_source'
];
$user_invite_info
[
'user_phone'
]
=
$userArr
[
'user_phone'
]
?
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$userArr
[
'user_phone'
])
:
''
;
$user_invite_info
[
'id'
]
=
$userArr
[
'id'
];
$user_invite_info
[
'user_phone'
]
=
$userArr
[
'user_phone'
]
?
preg_replace
(
'/(\d{3})\d{4}(\d{4})/'
,
'$1****$2'
,
$userArr
[
'user_phone'
])
:
''
;
$user_invite_info
[
'id'
]
=
$userArr
[
'id'
];
}
}
else
{
$model
=
new
AAgents
();
$model
=
new
AAgents
();
$result
=
$model
->
searchAgentsByKeyword
(
"id,name,phone"
,
[
"id"
=>
$user_res
[
'referrer_id'
]
]);
if
(
!
$result
)
{
$user_invite_info
=
[];
}
else
{
$user_invite_info
[
'referrer_source'
]
=
$user_res
[
'referrer_source'
];
$user_invite_info
[
'name'
]
=
$result
[
0
][
'name'
];
$user_invite_info
[
'phone'
]
=
$result
[
0
][
'phone'
];
$user_invite_info
[
'name'
]
=
$result
[
0
][
'name'
];
$user_invite_info
[
'phone'
]
=
$result
[
0
][
'phone'
];
}
}
$data
[
'user_invite_info'
]
=
$user_invite_info
;
...
...
@@ -509,15 +511,15 @@ class Broker extends Basic
// 判断当天被拨打是否超过5次,同时判断是否当前经纪人跟当前客户是否有电话绑定
//0允许拨打 1不允许拨打
$data
[
'is_outpace_call_num'
]
=
0
;
$clientService
=
new
ClientService
();
$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"
]]);
$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
)
{
$result
=
$call
->
getBindNum
(
$user_res
[
'user_phone'
],
$result
[
0
][
'phone'
]);
if
(
$result
!=
0
)
{
$data
[
'is_outpace_call_num'
]
=
0
;
}
...
...
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