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
b41ad3ca
Commit
b41ad3ca
authored
Mar 07, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
参数设置
parent
92b4e3cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
40 deletions
+66
-40
CellPhone.php
application/api_broker/controller/CellPhone.php
+62
-36
navigation.html
application/index/view/global/navigation.html
+4
-4
No files found.
application/api_broker/controller/CellPhone.php
View file @
b41ad3ca
...
...
@@ -14,7 +14,9 @@ use app\api_broker\untils\PlsDemo;
use
app\model\AAgentsPhone
;
use
app\model\AliYunPhone
;
use
app\model\BindingPhone
;
use
think\Cache
;
use
think\Db
;
use
think\Log
;
class
CellPhone
extends
Basic
{
...
...
@@ -37,43 +39,64 @@ class CellPhone extends Basic
$phone_a
=
$this
->
params
[
'phone_a'
];
//经纪人手机号
$phone_b
=
$this
->
params
[
'phone_b'
];
//客户手机号
$record
=
empty
(
$this
->
params
[
'record'
])
?
true
:
false
;
//是否录音
$setting
=
Cache
::
get
(
'Setting'
);
//获取配置
$aliYunPhone
=
new
AliYunPhone
();
$bind
=
new
BindingPhone
();
$field
=
'phone_x'
;
$where
[
'a.status'
]
=
1
;
$where
[
'a.phone_a'
]
=
$phone_a
;
$where
[
'a.phone_b'
]
=
$phone_b
;
$phone_x
=
$bind
->
getPhoneX
(
$field
,
$where
);
if
(
$phone_x
)
{
$this
->
data
=
[
'phone'
=>
$phone_x
[
'phone_x'
]];
}
else
{
$phone_x
=
$aliYunPhone
->
getAliYunPhone
(
$phone_b
);
//是否还有未绑定的中间号码
if
(
$setting
[
'is_privacy'
]
==
1
)
{
$phone_x
=
$bind
->
getPhoneX
(
$field
,
$where
);
if
(
$phone_x
)
{
$result
=
PlsDemo
::
bindAxb
(
$phone_a
,
$phone_b
,
_EXPIRATION
,
$record
,
$phone_x
[
'phone_x'
]);
if
(
$result
->
Message
==
'OK'
)
{
$aliYunPhone
->
where
(
'phone_x'
,
$phone_x
[
'phone_x'
])
->
setField
(
'status'
,
1
);
Db
::
table
(
'aliYun_binding_phone'
)
->
insert
([
'phone_a'
=>
$phone_a
,
'phone_b'
=>
$phone_b
,
'subsId'
=>
$result
->
SecretBindDTO
->
SubsId
,
'requestId'
=>
$result
->
RequestId
,
'record'
=>
$record
,
'aliYun_phone_id'
=>
$phone_x
[
'id'
],
'expiry_date'
=>
_EXPIRATION
,
]);
$this
->
msg
=
'Binding success.'
;
$this
->
data
=
[
'phone'
=>
$phone_x
[
'phone_x'
]];
$this
->
data
=
[
'phone'
=>
$phone_x
[
'phone_x'
]];
}
else
{
$phone_x
=
$aliYunPhone
->
getAliYunPhone
(
$phone_b
);
//是否还有未绑定的中间号码
if
(
$phone_x
)
{
if
(
empty
(
$setting
[
'day_num'
]))
{
$time
=
_EXPIRATION
;
}
else
{
$setting
[
'day_num'
]
+=
1
;
$time
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
"+
{
$setting
[
'day_num'
]
}
day"
));
}
$result
=
PlsDemo
::
bindAxb
(
$phone_a
,
$phone_b
,
$time
,
$record
,
$phone_x
[
'phone_x'
]);
if
(
$result
->
Message
==
'OK'
)
{
$aliYunPhone
->
where
(
'phone_x'
,
$phone_x
[
'phone_x'
])
->
setField
(
'status'
,
1
);
Db
::
table
(
'aliYun_binding_phone'
)
->
insert
([
'phone_a'
=>
$phone_a
,
'phone_b'
=>
$phone_b
,
'subsId'
=>
$result
->
SecretBindDTO
->
SubsId
,
'requestId'
=>
$result
->
RequestId
,
'record'
=>
$record
,
'aliYun_phone_id'
=>
$phone_x
[
'id'
],
'expiry_date'
=>
$time
,
]);
$this
->
msg
=
'Binding success.'
;
$this
->
data
=
[
'phone'
=>
$phone_x
[
'phone_x'
]];
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'绑定失败,请重试!'
;
}
Log
::
write
(
json_encode
(
$result
),
'AliYunBindAxb'
);
//记录日志
}
else
{
$this
->
code
=
10
1
;
$this
->
msg
=
'
绑定失败,请重试!
'
;
$this
->
code
=
10
2
;
$this
->
msg
=
'
号码使用完,请联系运营人员。
'
;
}
}
else
{
$this
->
code
=
102
;
$this
->
msg
=
'号码使用完,请联系运营人员。'
;
}
}
else
{
$this
->
data
=
[
'phone'
=>
$phone_b
];
Db
::
table
(
'aliYun_secret_report'
)
->
insert
([
'phone_no'
=>
$phone_a
,
'secret_no'
=>
$phone_b
,
'peer_no'
=>
$phone_b
,
'call_type'
=>
1
,
'record_down'
=>
3
,
]);
}
}
else
{
$this
->
code
=
101
;
...
...
@@ -129,20 +152,23 @@ class CellPhone extends Basic
$phone_b
=
$this
->
params
[
'phone_b'
];
if
(
$phone_x
&&
$phone_a
&&
$phone_b
)
{
$phone
=
new
BindingPhone
();
$subsId
=
$phone
->
getSubsId
(
$phone_x
,
$phone_a
,
$phone_b
,
1
);
$setting
=
Cache
::
get
(
'Setting'
);
//获取配置
if
(
$setting
[
'is_privacy'
]
==
1
)
{
$phone
=
new
BindingPhone
();
$subsId
=
$phone
->
getSubsId
(
$phone_x
,
$phone_a
,
$phone_b
,
1
);
if
(
$subsId
)
{
$result
=
PlsDemo
::
unbindSubscription
(
$subsId
,
$phone_x
);
if
(
$result
->
Message
==
'OK'
)
{
$phone
->
UnBind
(
$phone_x
);
if
(
$subsId
)
{
$result
=
PlsDemo
::
unbindSubscription
(
$subsId
,
$phone_x
);
if
(
$result
->
Message
==
'OK'
)
{
$phone
->
UnBind
(
$phone_x
);
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'remove binding error'
;
}
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'
remove binding error
'
;
$this
->
msg
=
'
dont\'t have about phone_x info
'
;
}
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'dont\'t have about phone_x info'
;
}
}
else
{
$this
->
code
=
101
;
...
...
application/index/view/global/navigation.html
View file @
b41ad3ca
...
...
@@ -37,7 +37,7 @@
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/version.html"
>
版本号管理
</a>
</li>
<!--
<li role="presentation">
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/auth.html"
>
角色管理
</a>
</li>
<li
role=
"presentation"
>
...
...
@@ -48,11 +48,11 @@
</li>
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/districtList.html"
>
部门列表
</a>
</li>
-->
</li>
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/remarkFollowIndex.html"
>
跟进列表
</a>
</li>
<!--
<li role="presentation">
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/authRuleIndex.html"
>
权限管理
</a>
</li>
<li
role=
"presentation"
>
...
...
@@ -63,7 +63,7 @@
</li>
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/BusinessDistrict.html"
>
商圈列表
</a>
</li>
-->
</li>
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/CellPhoneAgentIndex.html"
>
经纪人通话列表
</a>
</li>
...
...
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