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
0c7fcc15
Commit
0c7fcc15
authored
Feb 22, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
隐私号码保留7天有限期,绑定之前使用过的手机号码
parent
36e41edc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
4 deletions
+49
-4
config.php
application/api_broker/config.php
+1
-1
CellPhone.php
application/api_broker/controller/CellPhone.php
+7
-3
AliyunPhone.php
application/model/AliyunPhone.php
+41
-0
No files found.
application/api_broker/config.php
View file @
0c7fcc15
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
error_reporting
(
E_ERROR
|
E_PARSE
);
error_reporting
(
E_ERROR
|
E_PARSE
);
define
(
'_MESSAGE_TYPE'
,
'SecretReport'
);
define
(
'_MESSAGE_TYPE'
,
'SecretReport'
);
define
(
'_QUEUE_NAME'
,
'Alicom-Queue-1186048444498461-SecretReport'
);
define
(
'_QUEUE_NAME'
,
'Alicom-Queue-1186048444498461-SecretReport'
);
define
(
'_EXPIRATION'
,
518400
);
define
(
'_EXPIRATION'
,
date
(
'Y-m-d H:i:s'
,
time
()
+
518400
));
//手机号码保留七天
return
[
return
[
'jwt_key'
=>
'tonglian+123'
,
'jwt_key'
=>
'tonglian+123'
,
// 应用模式状态
// 应用模式状态
...
...
application/api_broker/controller/CellPhone.php
View file @
0c7fcc15
...
@@ -10,7 +10,8 @@ namespace app\api_broker\controller;
...
@@ -10,7 +10,8 @@ namespace app\api_broker\controller;
use
app\api_broker\extend\Basic
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\untils\PlsDemo
;
use
app\api_broker\untils\PlsDemo
;
use
app\model\BindingPhone
;
use
app\model\AliyunPhone
;
use
think\Config
;
use
think\Config
;
use
think\Db
;
use
think\Db
;
...
@@ -29,11 +30,14 @@ class CellPhone extends Basic
...
@@ -29,11 +30,14 @@ class CellPhone extends Basic
public
function
bindAXB
()
{
public
function
bindAXB
()
{
$params
=
$this
->
request
->
param
();
$params
=
$this
->
request
->
param
();
if
(
$params
[
'phone_a'
]
||
$params
[
'phone_b'
])
{
if
(
$params
[
'phone_a'
]
||
$params
[
'phone_b'
])
{
$expiration
=
date
(
'Y-m-d H:i:s'
,
time
()
+
_EXPIRATION
)
;
//过期时间
$expiration
=
_EXPIRATION
;
//过期时间
$phone_a
=
$this
->
params
[
'phone_a'
];
//经纪人手机号
$phone_a
=
$this
->
params
[
'phone_a'
];
//经纪人手机号
$phone_b
=
$this
->
params
[
'phone_b'
];
//客户手机号
$phone_b
=
$this
->
params
[
'phone_b'
];
//客户手机号
$record
=
empty
(
$this
->
params
[
'record'
])
?
false
:
true
;
//是否录音
$record
=
empty
(
$this
->
params
[
'record'
])
?
false
:
true
;
//是否录音
$result
=
PlsDemo
::
bindAxb
(
$phone_a
,
$phone_b
,
$expiration
,
$record
,
Config
::
get
(
'_DefaultPoolKey'
));
$bind
=
new
AliyunPhone
();
$phone_x
=
$bind
->
getAliYunPhone
(
$phone_b
);
$result
=
PlsDemo
::
bindAxb
(
$phone_a
,
$phone_b
,
$expiration
,
$record
,
Config
::
get
(
'_DefaultPoolKey'
),
$phone_x
);
if
(
$result
->
Message
==
'OK'
)
{
if
(
$result
->
Message
==
'OK'
)
{
Db
::
table
(
'aliyun_binding_phone'
)
->
save
([
Db
::
table
(
'aliyun_binding_phone'
)
->
save
([
...
...
application/model/AliyunPhone.php
0 → 100644
View file @
0c7fcc15
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/1/20
* Time: 17:52
*/
namespace
app\model
;
use
think\Db
;
class
AliyunPhone
extends
BaseModel
{
/**
* 获取未绑定的手机号码
*
* @param string $phone
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAliYunPhone
(
$phone
=
''
)
{
$where
[
'status'
]
=
1
;
if
(
$phone
)
{
//查询之前一次绑定关系的号码
$phone_x
=
Db
::
table
(
'aliyun_binding_phone'
)
->
field
(
'phone_x'
)
->
alias
(
'a'
)
->
join
(
'aliyun_phone b'
,
'a.aliyun_phone_id = b.id'
,
'left'
)
->
where
([
'phone_b'
=>
$phone
,
'a.status'
=>
1
])
->
value
(
'phone_x'
);
$where
[
'phone_x'
]
=
$phone_x
;
}
$result
=
Db
::
table
(
'aliyun_phone'
)
->
field
(
'phone_x'
)
->
whereOr
(
$where
)
->
find
();
return
$result
;
}
}
\ No newline at end of file
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