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
7849d4ee
Commit
7849d4ee
authored
Feb 23, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增或编辑中间号
parent
aa781485
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
Phone.php
application/index/controller/Phone.php
+43
-0
route.php
application/route.php
+1
-0
No files found.
application/index/controller/Phone.php
View file @
7849d4ee
...
...
@@ -31,6 +31,7 @@ class Phone extends Basic
$where
[
'phone_x'
]
=
$phone_x
;
}
$where
[
'status'
]
=
0
;
$where
[
'phone_pool_id'
]
=
1
;
$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
);
...
...
@@ -63,6 +64,7 @@ class Phone extends Basic
}
$where
[
'b.status'
]
=
1
;
$where
[
'a.phone_pool_id'
]
=
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
);
...
...
@@ -73,4 +75,44 @@ class Phone extends Basic
$data
[
'data'
][
'total'
]
=
$aliYun_phone
->
getPhoneListTotal
(
$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
edit_aliYunPhone
()
{
$phone_x
=
$this
->
params
[
'phone_x'
];
$id
=
$this
->
params
[
'id'
];
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
''
;
$phone
=
new
AliYunPhone
();
if
(
$this
->
request
->
isGet
())
{
//获取信息
$result
=
$phone
->
field
(
'id,phone_x'
)
->
where
(
'id'
,
$id
)
->
find
();
}
else
{
if
(
$id
)
{
//编辑
$result
=
$phone
->
save
([
'phone_x'
=>
$phone_x
,
'phone_pool_id'
=>
1
,
'monthly'
=>
$this
->
params
[
'monthly'
]
*
100
,
'cost'
=>
$this
->
params
[
'cost'
]
*
100
],[
'id'
=>
$id
]);
}
else
{
//新增
$result
=
$phone
->
save
([
'phone_x'
=>
$phone_x
,
'phone_pool_id'
=>
1
,
'monthly'
=>
$this
->
params
[
'monthly'
],
'cost'
=>
$this
->
params
[
'cost'
]
*
100
]);
}
}
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$result
);
}
}
\ No newline at end of file
application/route.php
View file @
7849d4ee
...
...
@@ -142,6 +142,7 @@ Route::group('index', [
'RemarkFollowList'
=>
[
'index/Remark/RemarkFollowList'
,[
'method'
=>
'get'
]],
//跟进列表【接口】
'phone_list'
=>
[
'index/Phone/index'
,[
'method'
=>
'get'
]],
//隐私号码列表
'bindPhoneList'
=>
[
'index/Phone/bindPhoneList'
,[
'method'
=>
'get'
]],
//绑定的隐私号码列表
'edit_aliYunPhone'
=>
[
'index/Phone/edit_aliYunPhone'
,[
'method'
=>
'get|post'
]],
//新增或编辑中间号
]);
...
...
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