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
9285e8af
Commit
9285e8af
authored
Aug 22, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拨打电话返回默认跟进
parent
e692831a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
19 deletions
+66
-19
Broker.php
application/api_broker/controller/Broker.php
+4
-5
CellPhone.php
application/api_broker/controller/CellPhone.php
+1
-1
CallPhoneService.php
application/api_broker/service/CallPhoneService.php
+30
-12
CellPhone.php
application/index/controller/CellPhone.php
+1
-1
UPhoneFollowPp.php
application/model/UPhoneFollowPp.php
+30
-0
No files found.
application/api_broker/controller/Broker.php
View file @
9285e8af
...
...
@@ -296,13 +296,12 @@ class Broker extends Basic
$params
[
'disc'
]
=
$result
[
0
][
'disc'
]
?
$result
[
0
][
'disc'
]
:
'黄浦区'
;
}
//主表查询商铺详细信息
$UPhoneFollowPp
=
new
UPhoneFollowPp
();
$UPhoneFollowPp
=
new
UPhoneFollowPp
();
$result
=
$UPhoneFollowPp
->
savePhoneFollow
(
$params
);
//跟进,对客户状态进行更新 0:求租;1:已租;-1:无效
$Users
->
update_user_status
([
'id'
=>
$user_id
,
'user_status'
=>
$user_status
]);
if
(
$result
==
1
)
{
if
(
$result
>
0
)
{
//跟进,对客户状态进行更新 0:求租;1:已租;-1:无效
$Users
->
update_user_status
([
'id'
=>
$user_id
,
'user_status'
=>
$user_status
]);
return
$this
->
response
(
"200"
,
"success!"
,
$result
);
}
else
{
return
$this
->
response
(
"101"
,
"失败!"
);
...
...
application/api_broker/controller/CellPhone.php
View file @
9285e8af
...
...
@@ -33,7 +33,7 @@ class CellPhone extends Basic
$call
=
new
CallPhoneService
();
$record
=
true
;
//是否录音
$user_id
=
empty
(
$this
->
params
[
'user_id'
])
?
0
:
(
int
)
$this
->
params
[
'user_id'
];
$result
=
$call
->
bindAXB
(
$this
->
params
[
'phone_a'
],
$this
->
params
[
'phone_b'
],
$record
,
$user_id
);
$result
=
$call
->
bindAXB
(
$this
->
params
[
'phone_a'
],
$this
->
params
[
'phone_b'
],
$record
,
$user_id
,
$this
->
agentId
);
if
(
$result
[
'status'
]
==
'success'
)
{
$this
->
msg
=
$result
[
'msg'
];
...
...
application/api_broker/service/CallPhoneService.php
View file @
9285e8af
...
...
@@ -15,6 +15,7 @@ use app\extra\RedisExt;
use
app\model\AliYunPhone
;
use
app\model\BindingPhone
;
use
app\model\SecretReport
;
use
app\model\UPhoneFollowPp
;
use
app\model\Users
;
use
think\Log
;
...
...
@@ -22,21 +23,24 @@ class CallPhoneService
{
private
$phone_a
=
''
;
private
$phone_b
=
''
;
private
$phone_x
=
''
;
private
$user_id
=
''
;
private
$phone_x
=
''
;
//中间号
private
$user_id
;
private
$agent_id
;
private
$expiry_date
=
''
;
private
$record
=
true
;
private
$release
=
1
;
private
$subs_id
=
''
;
private
$release
=
1
;
//是否释放
private
$subs_id
=
''
;
//阿里云释放参数
private
$request_id
=
''
;
private
$mapping_id
=
''
;
private
$mapping_id
=
''
;
//容联云释放参数
private
$is_privacy
=
0
;
//0直接拨打号码1阿里云隐私号码2容联云隐私号码
private
$day_num
=
0
;
//号码绑定有效期
private
$landlord_phone_day
=
0
;
//房东号码绑定有效期
private
$city
;
public
function
__construct
()
public
function
__construct
(
string
$city
=
'上海市'
)
{
$this
->
readRedis
();
$this
->
city
=
$city
;
}
/**
...
...
@@ -48,9 +52,10 @@ class CallPhoneService
* @param $phone_b
* @param bool $record
* @param int $user_id
* @param int $agent_id
* @return mixed
*/
public
function
bindAXB
(
$phone_a
,
$phone_b
,
$record
=
true
,
int
$user_id
)
public
function
bindAXB
(
$phone_a
,
$phone_b
,
$record
=
true
,
int
$user_id
,
int
$agent_id
)
{
$result
[
'status'
]
=
'failed'
;
...
...
@@ -88,13 +93,14 @@ class CallPhoneService
$this
->
phone_a
=
$phone_a
;
//经纪人手机号
$this
->
phone_b
=
$phone_b
;
//客户手机号
$this
->
record
=
$record
;
//是否录音
$this
->
agent_id
=
$agent_id
;
try
{
//0不使用隐私号码 1阿里云 2容联云
if
(
$this
->
is_privacy
==
0
)
{
$this
->
originalPhone
();
$result
[
'status'
]
=
'success'
;
$result
[
'phone'
]
=
$phone_b
;
$result
[
'status'
]
=
'success'
;
$result
[
'phone'
]
=
$phone_b
;
$result
[
'follow_id'
]
=
$this
->
addPhoneFollow
();
//打默认跟进
return
$result
;
}
...
...
@@ -137,7 +143,7 @@ class CallPhoneService
$result
[
'status'
]
=
'success'
;
$result
[
'phone'
]
=
$call_phone
[
'phone'
];
$result
[
'msg'
]
=
$call_phone
[
'msg'
];
$result
[
'follow_id'
]
=
$this
->
addPhoneFollow
();
//打默认跟进
$type
=
'AliYunBindAxb'
;
}
else
{
$result
[
'msg'
]
=
$call_phone
[
'msg'
];
...
...
@@ -149,7 +155,7 @@ class CallPhoneService
$result
[
'status'
]
=
'success'
;
$result
[
'phone'
]
=
$call_phone
[
'phone'
];
$result
[
'msg'
]
=
$call_phone
[
'msg'
];
$result
[
'follow_id'
]
=
$this
->
addPhoneFollow
();
//打默认跟进
$type
=
'YunTongXunBindAxb'
;
}
else
{
$result
[
'msg'
]
=
$call_phone
[
'msg'
];
...
...
@@ -391,4 +397,15 @@ class CallPhoneService
$this
->
landlord_phone_day
=
empty
(
$this
->
landlord_phone_day
)
?
1
:
$this
->
landlord_phone_day
;
}
/**
* 打默认跟进
*
* @return int|string
*/
private
function
addPhoneFollow
()
{
$follow
=
new
UPhoneFollowPp
();
$content
=
'拨打电话,未打跟进。'
;
$id
=
$follow
->
insertDefaultFollow
(
$this
->
agent_id
,
$this
->
user_id
,
$content
,
3
,
$this
->
city
);
return
$id
;
}
}
\ No newline at end of file
application/index/controller/CellPhone.php
View file @
9285e8af
...
...
@@ -156,7 +156,7 @@ class CellPhone extends Basic
}
$record
=
true
;
//录音
$call_phone
=
new
CallPhoneService
();
$data
=
$call_phone
->
bindAXB
(
$this
->
params
[
'phone_a'
],
$phone_b
,
$record
,
$user_id
);
$data
=
$call_phone
->
bindAXB
(
$this
->
params
[
'phone_a'
],
$phone_b
,
$record
,
$user_id
,
$this
->
userId
);
$result
[
'msg'
]
=
''
;
if
(
$data
[
'status'
]
==
'success'
)
{
$push
=
new
PushMessageService
();
...
...
application/model/UPhoneFollowPp.php
View file @
9285e8af
...
...
@@ -342,4 +342,34 @@ class UPhoneFollowPp extends BaseModel
//echo $this->getLastSql();
return
$return
;
}
/**
* 插入默认跟进
*
* @param $agent_id
* @param $user_id
* @param $content
* @param $type
* @param $city
* @return int|string
*/
public
function
insertDefaultFollow
(
$agent_id
,
$user_id
,
$content
,
$type
,
$city
)
{
$data
[
'agent_id'
]
=
$agent_id
;
$data
[
'user_id'
]
=
$user_id
;
$data
[
'content'
]
=
$content
;
$data
[
'city'
]
=
$city
;
if
(
$city
==
'上海市'
)
{
$data
[
'province'
]
=
'上海市'
;
$data
[
'disc'
]
=
'黄浦区'
;
}
if
(
$city
==
'杭州市'
)
{
$data
[
'province'
]
=
'浙江省'
;
$data
[
'disc'
]
=
'西湖区'
;
}
$data
[
'type'
]
=
$type
;
return
$this
->
insertGetId
(
$data
);
}
}
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