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
d0311ec4
Commit
d0311ec4
authored
Feb 23, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PC后台隐私号码
parent
c0f85e75
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
Phone.php
application/index/controller/Phone.php
+77
-0
No files found.
application/index/controller/Phone.php
0 → 100644
View file @
d0311ec4
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/2/23
* Time: 14:34
*/
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\model\AliYunPhone
;
class
Phone
extends
Basic
{
/**
* 号码池列表
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
index
()
{
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
""
;
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$phone_x
=
$this
->
params
[
'phone_x'
];
if
(
$phone_x
)
{
$where
[
'phone_x'
]
=
$phone_x
;
}
$where
[
'status'
]
=
0
;
$fields
=
'id,phone_x,monthly,cost,status,create_time'
;
$aliYun_phone
=
new
AliYunPhone
();
$data
[
'data'
][
'list'
]
=
$aliYun_phone
->
getList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$fields
,
$where
);
$data
[
'data'
][
'total'
]
=
$aliYun_phone
->
getTotal
(
$where
);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
/**
* 绑定号码列表
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
bindPhoneList
()
{
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
""
;
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$phone_a
=
$this
->
params
[
'phone_a'
];
$phone_b
=
$this
->
params
[
'phone_b'
];
if
(
$phone_a
)
{
$where
[
'phone_a'
]
=
$phone_a
;
}
if
(
$phone_b
)
{
$where
[
'phone_a'
]
=
$phone_b
;
}
$where
[
'b.status'
]
=
1
;
$fields
=
'a.id,b.id as bind_id,phone_x,phone_a,phone_b,record,b.create_time'
;
$aliYun_phone
=
new
AliYunPhone
();
$result
=
$aliYun_phone
->
getPhoneList
(
$pageNo
,
$pageSize
,
'b.id DESC'
,
$fields
,
$where
);
foreach
(
$result
as
$k
=>
$v
)
{
$result
[
$k
][
'expire_time'
]
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
$v
[
'create_time'
])
+
518400
);
//7天有限期
}
$data
[
'data'
][
'list'
]
=
$result
;
$data
[
'data'
][
'total'
]
=
$aliYun_phone
->
getPhoneListTotal
(
$where
);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'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