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
d2d75ee8
Commit
d2d75ee8
authored
Jun 28, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绑定号码天数
parent
a378e1c4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
12 deletions
+18
-12
CellPhone.php
application/api_broker/controller/CellPhone.php
+14
-10
BindingPhone.php
application/model/BindingPhone.php
+4
-2
No files found.
application/api_broker/controller/CellPhone.php
View file @
d2d75ee8
...
...
@@ -81,18 +81,23 @@ class CellPhone extends Basic
}
$day_num
=
$redis
->
get
(
's_day_num'
);
$release
=
1
;
//是否释放
if
(
empty
(
$day_num
))
{
$time
=
_EXPIRATION
;
}
else
{
if
(
empty
(
$this
->
params
[
'landlord'
]))
{
$day_num
+=
1
;
$time
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
"+
{
$day_num
}
day"
));
}
else
{
$day_num
=
$redis
->
get
(
's_landlord_phone_day'
);
if
(
$day_num
==
0
)
{
$time
=
date
(
'Y-m-d H:i:s'
,
time
()
+
5
);
$release
=
0
;
}
else
{
$landlord_phone_day
=
$redis
->
get
(
's_landlord_phone_day'
);
$day_num
=
$landlord_phone_day
+
1
;
}
$time
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
"+
{
$day_num
}
day"
));
}
}
}
if
(
$is_privacy
==
1
)
{
/*阿里云*/
...
...
@@ -105,7 +110,7 @@ class CellPhone extends Basic
if
(
$result
->
Code
==
'OK'
)
{
//记录绑定
$bind
->
recordBindPhone
(
$result
->
SecretBindDTO
->
SecretNo
,
$phone_a
,
$phone_b
,
$record
,
$time
,
$result
,
''
,
$is_privacy
);
$bind
->
recordBindPhone
(
$result
->
SecretBindDTO
->
SecretNo
,
$phone_a
,
$phone_b
,
$record
,
$time
,
$result
,
''
,
$is_privacy
,
$release
);
$this
->
msg
=
'绑定成功。'
;
$this
->
data
=
[
'phone'
=>
$result
->
SecretBindDTO
->
SecretNo
];
...
...
@@ -127,12 +132,12 @@ class CellPhone extends Basic
$aliYunPhone
=
new
AliYunPhone
();
$phone_x
=
$aliYunPhone
->
getAliYunPhone
(
$phone_a
,
$phone_b
,
$is_privacy
);
//获取未绑定隐号
$result
=
$Rong
->
setNumber
(
$phone_a
,
$phone_b
,
$phone_x
[
'phone_x'
],
$phone_x
[
'area'
],
$time
,
$record2
);
/*绑定成功*/
if
(
$result
[
'statusCode'
]
==
'000000'
)
{
$aliYunPhone
=
new
AliYunPhone
();
$aliYunPhone
->
editStatus
(
$phone_x
,
$phone_a
,
$phone_b
,
$record
,
$time
,
0
,
$result
[
'data'
][
'mappingId'
],
$is_privacy
);
//记录绑定
$bind
->
recordBindPhone
(
$phone_x
[
'phone_x'
],
$phone_a
,
$phone_b
,
$record
,
$time
,
0
,
$result
[
'data'
][
'mappingId'
],
$is_privacy
,
$release
);
//记录绑定
$this
->
msg
=
'绑定成功'
;
$this
->
data
=
[
'phone'
=>
$phone_x
[
'phone_x'
]
];
}
else
{
...
...
@@ -145,8 +150,7 @@ class CellPhone extends Basic
$result
=
$Rong
->
setNumber
(
$phone_a
,
$phone_b
,
$phone_x
[
'phone_x'
],
$phone_x
[
'area'
],
$time
,
$record2
);
if
(
$result
[
'statusCode'
]
==
'000000'
)
{
$aliYunPhone
=
new
AliYunPhone
();
$aliYunPhone
->
editStatus
(
$phone_x
,
$phone_a
,
$phone_b
,
$record
,
$time
,
0
,
$result
[
'data'
][
'mappingId'
],
$is_privacy
);
//记录绑定
$bind
->
recordBindPhone
(
$phone_x
[
'phone_x'
],
$phone_a
,
$phone_b
,
$record
,
$time
,
0
,
$result
[
'data'
][
'mappingId'
],
$is_privacy
,
$release
);
//记录绑定
$this
->
msg
=
'绑定成功'
;
$this
->
data
=
[
'phone'
=>
$phone_x
[
'phone_x'
]
];
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
...
...
application/model/BindingPhone.php
View file @
d2d75ee8
...
...
@@ -153,12 +153,13 @@ class BindingPhone extends BaseModel
* @param $result
* @param string $mappingId
* @param int $type
* @param int $status 绑定状态
* @return int|string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
recordBindPhone
(
$phone_x
,
$phone_a
,
$phone_b
,
$record
,
$time
,
$result
,
$mappingId
=
''
,
$type
=
1
)
public
function
recordBindPhone
(
$phone_x
,
$phone_a
,
$phone_b
,
$record
,
$time
,
$result
,
$mappingId
=
''
,
$type
=
1
,
$status
=
1
)
{
$m_ali_phone
=
new
AliYunPhone
();
$phone_id
=
$m_ali_phone
->
field
(
'id,bind_num'
)
->
where
(
'phone_x'
,
$phone_x
)
->
find
();
...
...
@@ -174,7 +175,7 @@ class BindingPhone extends BaseModel
$insert_data
[
'aliYun_phone_id'
]
=
$phone_id
[
'id'
];
$insert_data
[
'expiry_date'
]
=
$time
;
$insert_data
[
'type'
]
=
$type
;
$insert_data
[
'status'
]
=
1
;
$insert_data
[
'status'
]
=
$status
;
return
$this
->
insert
(
$insert_data
);
}
}
\ 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